Comments (11)
模型配的是:Qwen2-72B-Instruct-AWQ
"qwen2-72b-instruct-awq": {
"type": "openai",
"model": "qwen/Qwen2-72B-Instruct-AWQ",
"api_base": "http://localhost:8000/v1",
"is_chat": true,
"is_function_call": false
}
from modelscope-agent.
在环境变量定义DASHSCOPE_API_KEY了之后能往下跑了,但是还是会报错:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/work/modelscope-agent/apps/agentfabric/builder_core.py", line 60, in gen_response_and_process
for s in response:
File "/data/work/modelscope-agent/modelscope_agent/llm/dashscope.py", line 20, in stream_output
for trunk in response:
File "/data/work/modelscope-agent/modelscope_agent/llm/dashscope.py", line 142, in stat_last_call_token_info
if not chunk.usage.get('total_tokens'):
AttributeError: 'NoneType' object has no attribute 'get'
| step: | error: llm result is not valid
2024-07-07 14:59:58.225 - modelscope-agent - INFO - | message: frame | uuid: local_user | details: {'frame': '{'error': "llm result is not valid: 'NoneType' object has no attribute 'get'. Please reset and try again."}'} | step: | error:
2024-07-07 14:59:58.233 - modelscope-agent - INFO - | message: frame | uuid: local_user | details: {'frame': "{'error': 'llm result is not valid. parse RichConfig error. Please reset and try again.'}"} | step: | error:
2024-07-07 14:59:58.241 - modelscope-agent - ERROR - | message: | uuid: local_user | details: {} | step: | error: parse RichConfig error
No valid document. Return Empty Response
.
2024-07-07 15:00:09.693 - modelscope-agent - INFO - | message: call dashscope generation api | uuid: | details: {'model': 'qwen-max', 'messages': [{'role': 'user', 'content': 'What is the weather like in Boston?'}], 'stop': [{'type': 'function', 'function': {'name': 'get_current_weather', 'description': 'Get the current weather in a given location.', 'parameters': {'type': 'object', 'properties': {'location': {'type': 'string', 'description': 'The city and state, e.g. San Francisco, CA'}, 'unit': {'type': 'string', 'enum': ['celsius', 'fahrenheit']}}, 'required': ['location']}}}], 'top_p': 0.8, 'result_format': 'message', 'stream': True} | step: | error:
2024-07-07 15:00:09.700 - modelscope-agent - INFO - | message: call dashscope generation api | uuid: | details: {'model': 'qwen-max', 'messages': [{'role': 'user', 'content': '<|im_start|>system\n\n\n# 知识库\n\nEmpty Response\n\n\n# 工具\n\n## 你拥有如下工具:\n\nimage_gen: image_gen API。AI绘画(图像生成)服务,输入文本描述和图像分辨率,返回根据文本信息绘制的图片URL。 输入参数: {"type": "object", "properties": {"text": {"type": "string", "description": "详细描述了希望生成的图像具有什么内容,例如人物、环境、动作等细节描述"}, "resolution": {"type": "string", "description": "格式是 数字数字,表示希望生成的图像的分辨率大小,选项有[10241024, 7201280, 1280720]"}, "lora_index": {"type": "string", "description": "如果用户要求使用lora的情况下,则使用该参数,没有指定的情况下默认为wanx1.4.5_textlora_huiben2_20240518"}}, "required": ["text", "resolution"]} Format the arguments as a JSON object.\n\n## 当你需要调用工具时,请在你的回复中穿插如下的工具调用命令,可以根据需求调用零次或多次:\n\n工具调用\nAction: 工具的名称,必须是[image_gen]之一\nAction Input: 工具的输入\nObservation: 工具返回的结果\nAnswer: 根据Observation总结本次工具调用返回的结果,如果结果中出现url,请使用如下格式展示出来:\n\n\n# 指令\n\n你扮演AI-Agent,\n你具有下列具体功能:\n下面你将开始扮演\n\n请注意:你具有图像和视频的展示能力,也具有运行代码的能力,不要在回复中说你做不到。\n<|im_end|>\n<|im_start|>user\n(你正在扮演。你可以使用工具:[image_gen]。请查看前面的知识库)你可以做什么?<|im_end|>\n<|im_start|>assistant\n'}], 'stop': ['Observation:', 'Observation:\n'], 'top_p': 0.8, 'result_format': 'message', 'stream': True} | step: | error:
2024-07-07 15:00:09.701 - modelscope-agent - INFO - | message: call llm 1 times output: <generator object stream_output at 0x79f841e9b060>
from modelscope-agent.
2024-07-07 15:44:18.618 - modelscope-agent - INFO - | message: using builder model qwen2-72b-instruct-awq | uuid: local_user | details: {} | step: | error:
2024-07-07 15:44:18.619 - modelscope-agent - INFO - | message: client url http://localhost:8000/v1, client key: EMPTY
2024-07-07 15:44:18,667 - modelscope - INFO - initiate model from /data/work/nlp_gte_sentence-embedding_chinese-base
2024-07-07 15:44:18,667 - modelscope - INFO - initiate model from location /data/work/nlp_gte_sentence-embedding_chinese-base.
2024-07-07 15:44:18,668 - modelscope - INFO - initialize model from /data/work/nlp_gte_sentence-embedding_chinese-base
2024-07-07 15:44:19,958 - modelscope - WARNING - No preprocessor field found in cfg.
2024-07-07 15:44:19,958 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file.
2024-07-07 15:44:19,958 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': '/data/work/nlp_gte_sentence-embedding_chinese-base'}. trying to build by task and model information.
2024-07-07 15:44:19,984 - modelscope - WARNING - No preprocessor field found in cfg.
2024-07-07 15:44:19,984 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file.
2024-07-07 15:44:19,984 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': '/data/work/nlp_gte_sentence-embedding_chinese-base', 'sequence_length': 128}. trying to build by task and model information.
2024-07-07 15:44:20.020 - modelscope-agent - INFO - | message: using model qwen2-72b-instruct-awq with tool Config (path: ./config/tool_config.json): {'image_gen': {'name': 'Wanx Image Generation', 'is_active': True, 'use': False, 'is_remote_tool': True}, 'code_interpreter': {'name': 'Code Interpreter', 'is_active': True, 'use': False, 'is_remote_tool': False, 'max_output': 2000}, 'web_browser': {'name': 'Web Browsing', 'is_active': True, 'use': False, 'max_browser_length': 2000}, 'amap_weather': {'name': '高德天气', 'is_active': True, 'use': False}, 'paraformer_asr': {'name': 'Paraformer语音识别', 'is_active': True, 'use': False, 'is_remote_tool': True}, 'sambert_tts': {'name': 'Sambert语音合成', 'is_active': True, 'use': False, 'is_remote_tool': True}, 'wordart_texture_generation': {'name': '艺术字纹理生成', 'is_active': True, 'use': False}, 'web_search': {'name': 'Web Searching', 'is_active': True, 'use': False, 'searcher': 'bing'}, 'qwen_vl': {'name': 'Qwen-VL识图', 'is_active': True, 'use': False}, 'style_repaint': {'name': '人物风格重绘', 'is_active': True, 'use': False}, 'image_enhancement': {'name': '追影-放大镜', 'is_active': True, 'use': False}, 'text-address': {'name': '地址解析', 'url': 'https://api-inference.modelscope.cn/api-inference/v1/models/damo/mgeo_geographic_elements_tagging_chinese_base', 'use': False, 'is_active': True, 'is_remote_tool': True}, 'text-ner': {'name': '命名实体识别', 'url': 'https://api-inference.modelscope.cn/api-inference/v1/models/damo/nlp_raner_named-entity-recognition_chinese-base-cmeee', 'use': False, 'is_active': False, 'is_remote_tool': True}, 'speech-generation': {'name': '语音生成', 'url': 'https://api-inference.modelscope.cn/api-inference/v1/models/damo/speech_sambert-hifigan_tts_zh-cn_16k', 'use': False, 'is_active': True, 'is_remote_tool': True}, 'video-generation': {'name': '视频生成', 'url': 'https://api-inference.modelscope.cn/api-inference/v1/models/damo/text-to-video-synthesis', 'use': False, 'is_active': True, 'is_remote_tool': True}, 'text-translation-en2zh': {'name': '英译中', 'url': 'https://api-inference.modelscope.cn/api-inference/v1/models/damo/nlp_csanmt_translation_en2zh', 'use': False, 'is_active': False, 'is_remote_tool': True}, 'text-translation-zh2en': {'name': '中译英', 'url': 'https://api-inference.modelscope.cn/api-inference/v1/models/damo/nlp_csanmt_translation_zh2en', 'use': False, 'is_active': False, 'is_remote_tool': True}} and function list [] | uuid: local_user | details: {'model_config': {'type': 'openai', 'model': 'qwen/Qwen2-72B-Instruct-AWQ', 'api_base': 'http://localhost:8000/v1', 'is_chat': True, 'is_function_call': False, 'generate_cfg': {'top_p': 0.5, 'stop': 'Observation'}}} | step: | error:
2024-07-07 15:44:20.020 - modelscope-agent - INFO - | message: client url http://localhost:8000/v1, client key: EMPTY
Neither documents nor cache_dir.
No valid document. Return Empty Response
.
2024-07-07 15:44:23.533 - modelscope-agent - INFO - | message: call llm 1 times output: <generator object OpenAi._chat_stream at 0x71e1c22cfd10>
2024-07-07 15:44:23.534 - modelscope-agent - INFO - | message: call openai api, model: qwen/Qwen2-72B-Instruct-AWQ, messages: [{'role': 'system', 'content': "\n\n# 知识库\n\nEmpty Response\n\n\n# 指令\n\n你扮演AI-Agent,你的名字是agent-demo。you're an agent \n你具有下列具体功能:\n下面你将开始扮演agent-demo\n\n请注意:你具有图像和视频的展示能力,也具有运行代码的能力,不要在回复中说你做不到。\n"}, {'role': 'user', 'content': '(你正在扮演agent-demo。请查看前面的知识库)你有什么功能?'}], stop: ['Observation:', 'Observation:\n'], stream: True, args: {'user_token': ''}
from modelscope-agent.
what is your modelscope-agent version?
from modelscope-agent.
模型配的是:Qwen2-72B-Instruct-AWQ
"qwen2-72b-instruct-awq": { "type": "openai", "model": "qwen/Qwen2-72B-Instruct-AWQ", "api_base": "http://localhost:8000/v1", "is_chat": true, "is_function_call": false }
what is your llm_config?
from modelscope-agent.
what is your modelscope-agent version?
用的是本地部署哪个流程,因为有docker缺少新版本的引用,所以用的官方推荐的 git checkout 8deef6d 这个版本。
from modelscope-agent.
模型配的是:Qwen2-72B-Instruct-AWQ
"qwen2-72b-instruct-awq": { "type": "openai", "model": "qwen/Qwen2-72B-Instruct-AWQ", "api_base": "http://localhost:8000/v1", "is_chat": true, "is_function_call": false }what is your llm_config?
官方本地话部署里面没写要单独修改llm_config啊。只是编辑 modelscope-agent/apps/agentfabric/config/model_config.json, 增加了本地模型的配置。顺便问一下,咱们框架跑起来好多地方的默认都会要 DASHSCOPE_API_KEY 。对于开源框架的使用来说感觉不太解耦。纯本地化部署有点跑不起来
from modelscope-agent.
直接用最新的master分支,然后 pip install -e . 安装一下试试。
what is your modelscope-agent version?
用的是本地部署哪个流程,因为有docker缺少新版本的引用,所以用的官方推荐的 git checkout 8deef6d 这个版本。
from modelscope-agent.
模型配的是:Qwen2-72B-Instruct-AWQ
"qwen2-72b-instruct-awq": { "type": "openai", "model": "qwen/Qwen2-72B-Instruct-AWQ", "api_base": "http://localhost:8000/v1", "is_chat": true, "is_function_call": false }what is your llm_config?
官方本地话部署里面没写要单独修改llm_config啊。只是编辑 modelscope-agent/apps/agentfabric/config/model_config.json, 增加了本地模型的配置。顺便问一下,咱们框架跑起来好多地方的默认都会要 DASHSCOPE_API_KEY 。对于开源框架的使用来说感觉不太解耦。纯本地化部署有点跑不起来
嗯,主要就是基础模型调用的是qwen-max 需要dashscope。
那你在agentfabric里面有没有选择用你这个模型进行推理,而不是用默认的,默认的会请求qwen-max,就会依赖dashscope
from modelscope-agent.
直接用最新的master分支,然后 pip install -e . 安装一下试试。
what is your modelscope-agent version?
用的是本地部署哪个流程,因为有docker缺少新版本的引用,所以用的官方推荐的 git checkout 8deef6d 这个版本。
![image](https://private-user-images.githubusercontent.com/4996510/346870669-faf3d75c-56ca-43b0-9270-6da592c0df70.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIyNTkzNjMsIm5iZiI6MTcyMjI1OTA2MywicGF0aCI6Ii80OTk2NTEwLzM0Njg3MDY2OS1mYWYzZDc1Yy01NmNhLTQzYjAtOTI3MC02ZGE1OTJjMGRmNzAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjlUMTMxNzQzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDQ1NjMxZTYwYjI3ODQzNWE5N2U3ZmRlNDczNjQzYmY2MTA1NmI5OWFhMTEzYzkzMzE1YmQ0NWRlMWMxZGNkZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.BD-5_GWYKDgcTNp2Q5dtYbnbCaMQmUsblB3Dez-lw24)
from modelscope-agent.
from modelscope-agent.
Related Issues (20)
- Tool Nonimplementation Error HOT 2
- [<Agent component: framework|tool|llm|etc...>] HOT 1
- TypeError: Can't instantiate abstract class Vllm with abstract method _chat_no_stream HOT 2
- [framework] Refactor Non-Core Requirements to Runtime/On-Demand Dependencies HOT 1
- qwen1.5和qwen2调用agent方式不一样吗?? HOT 5
- Bad example: With Modelscope-Agent-Server, Qwen2 could be used by OpenAI SDK with tool calling ability, please find detail in doc. HOT 3
- [<Agent component: framework|tool|llm|etc...>] ollama._types.ResponseError: pull model manifest: file does not exist
- llm:调用vllm部署的大模型openai接口时报错 HOT 2
- 无法用dashscope model server使用OpenAI SDK HOT 13
- max_tokens must be at least 1, got -160 HOT 1
- 调用qwen-max模型,还需要消耗显存吗 HOT 2
- MSAgent-Bench的benchmark有没有具体的评估脚本?
- 使用这个 sh scripts/run_assistant_server.sh 部署模型之后,会不会比VLLM速度慢很多 HOT 8
- 参照文档搭建支持function calling的qwen2 openai server时报错openai.BadRequestError: Error code: 400
- MemoryWithRag 方法传了本地的llm模型,但是还是提示AssertionError: DASHSCOPE_API_KEY should be set in environ. HOT 2
- [Agentfabric]: need stop current round, retry last round HOT 1
- 如何可以使用http://0.0.0.0:7860本地访问,而不是默认的http://127.0.0.1:7860访问 HOT 1
- [tool] 运行 langchian_as_third_party_tools.ipynb 和 openapi_schema_tool.ipynb 时工具注册失败 HOT 1
- 知识库文件上传一个可以,但是两个以上会报错
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modelscope-agent.