Instructions to use zhichen/Qwen-WisdomVast with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zhichen/Qwen-WisdomVast with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="zhichen/Qwen-WisdomVast") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("zhichen/Qwen-WisdomVast") model = AutoModelForCausalLM.from_pretrained("zhichen/Qwen-WisdomVast") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use zhichen/Qwen-WisdomVast with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zhichen/Qwen-WisdomVast" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zhichen/Qwen-WisdomVast", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/zhichen/Qwen-WisdomVast
- SGLang
How to use zhichen/Qwen-WisdomVast with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "zhichen/Qwen-WisdomVast" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zhichen/Qwen-WisdomVast", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "zhichen/Qwen-WisdomVast" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zhichen/Qwen-WisdomVast", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use zhichen/Qwen-WisdomVast with Docker Model Runner:
docker model run hf.co/zhichen/Qwen-WisdomVast
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
介绍
Qwen-WisdomVast是以Qwen1.5-7B为底座,使用 DORA + LORA+ 的训练方法,在100w高质量中文多轮SFT数据 + 20w英文多轮SFT数据 + 2000单轮自我认知数据训练而来的大模型,数学能力相比Qwen1.5-7B-Chat提升了5.16%,在HumanEval数据集上相比Qwen1.5-7B-Chat提升了12.8,在MBPP数据集上提升了11.6%,在BBH数据集上 提升了12.44% ,全部评测表现见下表。
Github:https://github.com/seanzhang-zhichen/Qwen-WisdomVast
评测表现
| Model | MMLU | C-Eval | GSM8K | MATH | HumanEval | MBPP | BBH |
|---|---|---|---|---|---|---|---|
| Qwen1.5-7B-Chat | 60.88 | 70.18 | 54.13 | 7.96 | 31.10 | 15.00 | 31.67 |
| Qwen-WisdomVast | 57.09 | 70.82 | 51.93 | 13.12 | 43.90 | 26.60 | 44.11 |
说明:
由于官方并未公布Qwen1.5-7B-Chat的评测表现,所以我们自己使用opencompass测试得到以上结果
Qwen-WisdomVast使用和Qwen1.5-7B-Chat一样的参数进行测试
模型下载
| Model | Download |
|---|---|
| Qwen1.5-7B | 🤗 HuggingFace 🤖 ModelScope |
| Qwen-WisdomVast-Lora | 🤗 HuggingFace 🤖 ModelScope |
| Qwen-WisdomVast (合并好的模型) | 🤗 HuggingFace 🤖 ModelScope |
合并LORA模型(可跳过)
1、下载 Qwen1.5-7B
git clone https://www.modelscope.cn/qwen/Qwen1.5-7B.git
From ModelScope
git lfs install
git clone https://www.modelscope.cn/seanzhang/Qwen-WisdomVast-Lora.git
From HuggingFace
git lfs install
git clone https://huggingface.co/zhichen/Qwen-WisdomVast-Lora
3、合并模型
python merge_lora.py \
--base_model path/to/qwen/Qwen1.5-7B \
--lora_model path/to/lora/Qwen-WisdomVast-Lora \
--output_dir ./Qwen-WisdomVast
下载 Qwen-WisdomVast(合并好的模型)
From ModelScope
git lfs install
git clone https://www.modelscope.cn/seanzhang/Qwen-WisdomVast.git
From HuggingFace
git lfs install
git clone https://huggingface.co/zhichen/Qwen-WisdomVast
命令行推理
python cli_demo.py --model_path ./Qwen-WisdomVast(换成你自己的合并后的模型路径)
web 推理
python web_demo.py --model_path ./Qwen-WisdomVast(换成你自己的合并后的模型路径)
vllm web 推理
1、使用vllm部署模型
python -m vllm.entrypoints.openai.api_server --served-model-name Qwen-WisdomVast --model ./Qwen-WisdomVast(换成你自己的合并后的模型路径)
2、在命令行执行
python vllm_web_demo.py --model Qwen-WisdomVast
复现测试结果
1、使用vllm部署openai api server
部署命令:
python -m vllm.entrypoints.openai.api_server --served-model-name Qwen-WisdomVast --model ./Qwen-WisdomVast(换成你自己的合并后的模型路径)
2、使用opencompass框架进行测试
按照以上文章修改好后,将eval_qwen_wisdomvast.py文件到 opencompass/configs文件夹下
3、执行测试脚本
python run.py configs/eval_qwen_wisdomvast.py -w outputs/Qwen-WisdomVast
LICENSE
本项目仅可应用于研究目的,项目开发者不承担任何因使用本项目(包含但不限于数据、模型、代码等)导致的危害或损失。详细请参考免责声明。
Qwen-WisdomVast项目代码的授权协议为 The Apache License 2.0,代码可免费用做商业用途,模型权重和数据只能用于研究目的。请在产品说明中附加Qwen-WisdomVast的链接和授权协议。
Citation
如果你在研究中使用了Qwen-WisdomVast,请按如下格式引用:
@misc{Qwen-WisdomVast,
title={Qwen-WisdomVast},
author={Zhichen Zhang, Weihan Huang},
year={2024},
howpublished={\url{https://github.com/seanzhang-zhichen/Qwen-WisdomVast}},
}
Acknowledgement
QwenLM/Qwen1.5
hiyouga/LLaMA-Factory
shibing624/MedicalGPT
modelscope/swift
Star History
- Downloads last month
- 3
