还没有上过手,等我上过手了会来补更多内容。
中文文档:https://qwen.readthedocs.io/zh-cn/latest/
Qwen现在最新出到2.5版。由于Qwen 2+和Qwen之间并不兼容,所以本文仅包括Qwen2.5的相关实操内容,对于Qwen的技术报告解读等相关内容会另写博文。
Qwen是类GPT的decoder-only架构,自回归模型,分词方式也是BPE。
提供 0.5B 、1.5B 、3B 、7B 、14B 、32B 和 72B 共7种参数规模的模型,并且有基模型和指令微调模型两种变体。
可以处理 32K 或 128K token 长的文本,其中 8K 长度可作为输出。(可以用YaRN进行扩展)
有纯文本、视觉、音频模型,有专门针对代码和数学进行优化的模型。
没开源的模型可以用API:https://www.alibabacloud.com/help/zh/model-studio/developer-reference/use-qwen-by-calling-api
或者从网页端访问:https://chat.qwenlm.ai/
已开源的模型可以本地部署,也可以架API,transformers格式和OpenAI API格式都支持,教程:
https://qwen.readthedocs.io/zh-cn/latest/getting_started/quickstart.html
transformers版详细教程:https://qwen.readthedocs.io/zh-cn/latest/inference/chat.html
Ollama:https://qwen.readthedocs.io/zh-cn/latest/run_locally/ollama.html
llama.cpp:https://qwen.readthedocs.io/zh-cn/latest/run_locally/llama.cpp.html
LM Studio
Web UI:https://qwen.readthedocs.io/zh-cn/latest/web_ui/text_generation_webui.html
vLLM:https://qwen.readthedocs.io/zh-cn/latest/deployment/vllm.html
TGI:https://qwen.readthedocs.io/zh-cn/latest/deployment/tgi.html
SkiPilot:https://qwen.readthedocs.io/zh-cn/latest/deployment/skypilot.html
OpenLLM:https://qwen.readthedocs.io/zh-cn/latest/deployment/openllm.html(这个还会显示required GPU RAM 和支持的操作系统,看起来挺智能的)
(方便使用RAG)LlamaIndex:https://qwen.readthedocs.io/zh-cn/latest/framework/LlamaIndex.html
(方便使用RAG)Langchain:https://qwen.readthedocs.io/zh-cn/latest/framework/Langchain.html
具体的我自己还没试,等试了再写。
官方文档还给出了推荐量化方式,略。
用LLaMA Factory进行SFT:https://qwen.readthedocs.io/zh-cn/latest/training/SFT/llama_factory.html