超过ChatGPT3达到ChatGPT4%90性能的小羊驼来了-Vicuna(校招社招必备,chatgpt风口来了赶紧学起来吧)

达到GPT4百分之90性能的小羊驼Vicuna



随着chatgpt大火,很多人都开始学习chatgpt相关知识,本文就介绍一下最近很火的小羊驼Vicuna项目。


一、小羊驼Vicuna介绍

一群来自UCB(主导这个项目)、CMU、Stanford、UCSD的充满热情且能力强劲的学生共同实现了以合规,廉价和高效的方式做出真正意义上和ChatGPT-3.5 相当的开源版本ChatGPT,GPT-4 给我们模型的“总分”最终达到了ChatGPT的90%

二、使用效果测评

话不多说先上图,这是我们在服务器上部署Vicuna-13b测试的效果
让小羊驼帮我写了一个汽车的广告
让小羊驼帮我写了一个汽车的广告
在这里插入图片描述
让小羊驼帮我根据一段新闻生成标题

三、小羊驼Vicuna安装webui linux部署教程

3.1 下载代码安装虚拟环境

下载代码
git clone https://github.com/lm-sys/FastChat
cd FastChat
使用conda安装虚拟环境
我使用的是A100显卡  python版本是3.8

先安装几个单独的包
# Install FastChat
pip3 install fschat

# Install the latest main branch of huggingface/transformers
pip3 install git+https://github.com/huggingface/transformers

pip3 install --upgrade pip  # enable PEP 660 support
pip3 install -e .

3.2 下载权重文件

然后开始下载权重文件,分别是13b和7b,需要主要是是你cpu的内存要够,64g最佳

Vicuna-13B
This conversion command needs around 60 GB of CPU RAM.

python3 -m fastchat.model.apply_delta \
    --base /path/to/llama-13b \
    --target /output/path/to/vicuna-13b \
    --delta lmsys/vicuna-13b-delta-v0
Vicuna-7B
This conversion command needs around 30 GB of CPU RAM.

python3 -m fastchat.model.apply_delta \
    --base /path/to/llama-7b \
    --target /output/path/to/vicuna-7b \
    --delta lmsys/vicuna-7b-delta-v0
--base 是你原始的llama-7b 权重文件的路径
--target 是你生成的小羊驼权重文件的存储路径

3.3 启动命令
启动方式分为命令行启动和webui启动方式
3.3.1 命令行启动方式

单GPU启动命令
The command below requires around 28GB of GPU memory for Vicuna-13B and 14GB of GPU memory for Vicuna-7B.

python3 -m fastchat.serve.cli --model-name /path/to/vicuna/weights
多GPU启动命令
If you do not have enough GPU memory, you can use model parallelism to aggregate memory from multiple GPUs on the same machine.

python3 -m fastchat.serve.cli --model-name /path/to/vicuna/weights --num-gpus 2
使用CPU启动的命令,不建议很吃CPU配置,并且很慢
This runs on the CPU only and does not require GPU. It requires around 60GB of CPU memory for Vicuna-13B and around 30GB of CPU memory for Vicuna-7B.

python3 -m fastchat.serve.cli --model-name /path/to/vicuna/weights --device cpu

3.3.2
webui启动方式

python3 -m fastchat.serve.controller

python3 -m fastchat.serve.model_worker --model-path /path/to/vicuna/weights

python3 -m fastchat.serve.test_message --model-name vicuna-13b

总结踩坑经验

例如:内存一定要够,要不然启动不起来服务,显存保底40G,才能稳定的保证webui服务启动起来,因为多轮对话以后显存涨的很快

猜你喜欢

转载自blog.csdn.net/weixin_43228814/article/details/130021598
今日推荐