AI之JARVIS:JARVIS(连接众多 AI 模型以解决复杂 AI 任务的接口/可理解为一种超智能AI模型管家,正开发中)的简介、安装、使用方法之详细攻略
目录
JARVIS(一种超智能AI模型管家)的简介
JARVIS(一种超智能AI模型管家)的安装
1、硬件要求
2、获取Key
3、通过 Web API 访问 Jarvis 的服务
JARVIS(一种超智能AI模型管家)的使用方法
1、Hugging GPT
语言作为 LLM 连接众多 AI 模型以解决复杂 AI 任务的接口。JARVIS(引入了一个协作系统,该系统由作为控制器的 LLM和作为协作执行者的众多专家模型组成(来自 HuggingFace Hub)。JARVIS(系统的工作流程包括四个阶段:
GitHub:GitHub - microsoft/JARVIS: JARVIS, a system to connect LLMs with ML community. Paper: https://arxiv.org/pdf/2303.17580.pdf
官方论文:https://arxiv.org/abs/2303.17580
For config.yaml
:
damo-vilab/text-to-video-ms-1.7b
ControlNet
stable-diffusion-v1-5
该配置lite.yaml
不需要在本地下载和部署任何专家模型。然而,这意味着 Jarvis 仅限于在 HuggingFace Inference Endpoints 上稳定运行的模型。
首先用你个人的 OpenAI Key和你的 Hugging Face Tokenopenai.key
替换and huggingface.token
in ,或者把它们放到环境变量里。然后运行以下命令:server/config.yaml
OPENAI_API_KEY
HUGGINGFACE_ACCESS_TOKEN
# setup env
cd server
conda create -n jarvis python=3.8
conda activate jarvis
conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
pip install -r requirements.txt
# download models. Make sure that `git-lfs` is installed.
cd models
bash download.sh # required when `inference_mode` is `local` or `hybrid`.
# run server
cd ..
python models_server.py --config config.yaml # required when `inference_mode` is `local` or `hybrid`
python awesome_chat.py --config config.yaml --mode server # for text-davinci-003
/hugginggpt
--method POST
,访问完整的服务。/tasks
--method POST
,访问阶段 #1 的中间结果。/results
--method POST
,访问阶段 #1-3 的中间结果。# request
curl --location 'http://localhost:8004/tasks' \
--header 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "user",
"content": "based on pose of /examples/d.jpg and content of /examples/e.jpg, please show me a new image"
}
]
}'
# response
[{"args":{"image":"/examples/d.jpg"},"dep":[-1],"id":0,"task":"openpose-control"},{"args":{"image":"/examples/e.jpg"},"dep":[-1],"id":1,"task":"image-to-text"},{"args":{"image":"-0","text":"-1"},"dep":[1,0],"id":2,"task":"openpose-text-to-image"}]