Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

加载本地下载的qwen2.5模型 #425

Open
DonJonMao opened this issue Jan 2, 2025 · 4 comments
Open

加载本地下载的qwen2.5模型 #425

DonJonMao opened this issue Jan 2, 2025 · 4 comments

Comments

@DonJonMao
Copy link

作者您好,function_calling.py中通过get_chat_model加载模型,请问该如何加载本地下载的qwen模型?我没有找到相关函数,能否给我一个例子,谢谢

@tuhahaha
Copy link
Collaborator

tuhahaha commented Jan 3, 2025

您可以将本地的qwen2.5模型启动vllm server,然后用oai接口去访问模型即可。

@DonJonMao
Copy link
Author

您可以将本地的qwen2.5模型启动vllm server,然后用oai接口去访问模型即可。

请问这种方法还是需要调用openapi的api来实现吗?还是需要openai api和key吗

@tuhahaha
Copy link
Collaborator

tuhahaha commented Jan 6, 2025

本地部署的不需要openai api和key,参考这个参数配置,只需要传入本地部署的url即可。

@DonJonMao
Copy link
Author

本地部署的不需要openai api和key,参考这个参数配置,只需要传入本地部署的url即可。

成功启动,感谢作者回复!记录一下过程供有需要的朋友参考:
1.vllm挂载模型
例如:python -m vllm.entrypoints.openai.api_server --host 127.0.0.1 --port 6006 --model /home/users/Projects/Qwen2-0.5B-Instruct --served-model-name Qwen2-0.5B --gpu-memory-utilization=0.5 --max-model-len=2048
2.修改function_calling.py参数,如:
'model': 'Qwen2-0.5B',
'model_server': 'http://127.0.0.1:6006/v1', # api_base
'api_key': 'EMPTY',
model和--served-model-name对应
3.python function_calling.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants