Replies: 1 comment
-
Hello, it seems that you have chosen "modelscope" as your model server. However, please note that this model server type has not been maintained and adapted recently. Additionally, different models have different input and output formats, which makes maintenance difficult. We suggest that you use the VLLM deployment service to unify the format. You can use the following code: import os os.environ['MODELSCOPE_CACHE'] = "/mnt/workspace/yangkun/yk_cache" model_dir = snapshot_download('ZhipuAI/chatglm3-6b') The above code allows downloading the model from ModelScope. curl -X POST 'http://localhost:31512/v1/chat/completions' For detailed documentation, please refer to this link |
Beta Was this translation helpful? Give feedback.
-
Hi,
When running the model agent, I encountered the following error msg: ValueError: The current
device_map
had weights offloaded to the disk. Please provide anoffload_folder
for them. Alternatively, make sure you havesafetensors
installed if the model you are using offers the weights in this format.I tried to look it up but have not found a way to set up this folder. Thank you! The detailed code of the agent set up is as followed:
rom modelscope_agent.agents.role_play import RolePlay
role_template = """
你是一位精通金融信息分析的ai助手。
你需要遵守的规则是:
1. 必须使用中文结合查询的背景信息结合你所拥有的知识回答用户提出的问题。
2. 结构化答案生成,必要时通过空行提升阅读体验。
3. 不采用背景信息中的错误信息。
4. 要考虑答案和问题的相关性,不做对问题没有帮助的回答。
5. 详尽回答问题,重点突出,不过多花哨词藻。
6. 不说模糊的推测。
7. 尽量多的使用数值类信息。
"""
llm_config = {'model': 'ZhipuAI/chatglm3-6b', 'model_server': 'modelscope'}
input tool name
function_list = ['get-index']
storage_path
offload_folder = 'D:\PPT&WORD\folder\model_training'
bot = RolePlay(
function_list=function_list, llm=llm_config, instruction=role_template, storage_path=offload_folder)
Beta Was this translation helpful? Give feedback.
All reactions