eosphoros-ai / DB-GPT

AI Native Data App Development framework with AWEL(Agentic Workflow Expression Language) and Agents
http://docs.dbgpt.cn
MIT License
13.25k stars 1.76k forks source link

[Bug] [Module Name] zhipu—— #1454

Open zhangkuo-zk opened 4 months ago

zhangkuo-zk commented 4 months ago

Search before asking

Operating system information

MacOS(x86)

Python version information

3.10

DB-GPT version

latest release

Related scenes

Installation Information

Device information

MAc M2 Pro

Models information

.env: LLM_MODEL=zhipu_proxyllm MODEL_SERVER=http://127.0.0.1:8000 LIMIT_MODEL_CONCURRENCY=5 MAX_POSITION_EMBEDDINGS=4096 QUANTIZE_QLORA=True QUANTIZE_8bit=True EMBEDDING_MODEL=text2vec KNOWLEDGE_CHUNK_SIZE=500 KNOWLEDGE_SEARCH_TOP_SIZE=5 KNOWLEDGE_CHAT_SHOW_RELATIONS=False KNOWLEDGE_SEARCH_REWRITE=False LOCAL_DB_TYPE=mysql LOCAL_DB_USER=root LOCAL_DB_PASSWORD=**** LOCAL_DB_HOST=127.0.0.1 LOCAL_DB_PORT=3306 LOCAL_DB_NAME=dbgpt EXECUTE_LOCAL_COMMANDS=False PROXY_SERVER_URL=https://open.bigmodel.cn/api/paas/v4/chat/completions BARD_PROXY_API_KEY={your-bard-token} TONGYI_PROXY_API_KEY={your-tongyi-sk} ZHIPU_MODEL_VERSION=glm-3-turbo ZHIPU_PROXY_API_KEY=4af5a6b9011852bc3f38ae193d65b5bf.X6aPkEBJq94yOgds SUMMARY_CONFIG=FAST DBGPT_LOG_LEVEL=INFO

What happened

full stream output:

model generate_stream params: {'model': 'zhipu_proxyllm', 'messages': [ModelMessage(role='human', content='q', round_index=1), ModelMessage(role='human', content='You are a helpful AI assistant.\n1', round_index=0)], 'temperature': 0.6, 'max_new_tokens': 1024, 'echo': False, 'span_id': 'f33a549c-553d-4010-874b-6e4e03bd5318:0ffd8a45-ddb4-4d3b-820d-53cde063a7cb', 'context': {'stream': True, 'cache_enable': False, 'user_name': None, 'sys_code': None, 'conv_uid': None, 'span_id': 'f33a549c-553d-4010-874b-6e4e03bd5318:93084696-026a-451e-978e-0925e5e56ad0', 'chat_mode': 'chat_normal', 'chat_param': None, 'extra': {}, 'request_id': None}, 'convert_to_compatible_format': False, 'string_prompt': 'human: q\nhuman: You are a helpful AI assistant.\n1'} Traceback (most recent call last): File "/Library/Studying/privateLLM/DB-GPT/dbgpt/app/scene/base_chat.py", line 294, in stream_call self.current_message.add_ai_message(msg) UnboundLocalError: local variable 'msg' referenced before assignment

2024-04-23 17:08:26 MacBook-Pro dbgpt.app.scene.base_chat[77234] ERROR model response parse failed!local variable 'msg' referenced before assignment

What you expected to happen

没有连接到zhipu

How to reproduce

1:直接对话

Additional context

No response

Are you willing to submit PR?

zhangkuo-zk commented 4 months ago

已解决 ,url问题

Jimmy1456 commented 4 months ago

已解决 ,url问题

老哥,能详细说下吗,url应该怎么设置

Jimmy1456 commented 4 months ago

已解决 ,url问题

老哥,能详细说下吗,url应该怎么设置

fix,just pip install zhipuai==1.0.7

1037

wangcaizi commented 3 months ago

已解决 ,url问题

url哪错了?

zhangkuo-zk commented 3 months ago

使用1.0.7版本 pip install zhipuai==1.0.7

czhmisaka commented 3 months ago

再使用了 zhipuai 1.0.7 之后有一个报错 2024-05-22 16:42:34 czh.local dbgpt.model.cluster.worker.manager[29907] ERROR Error starting worker manager: model zhipu_proxyllm@proxy(10.29.109.135:5670) start failed, Traceback (most recent call last): File "/Users/chenzhihan/Desktop/github/DB-GPT/dbgpt/model/cluster/worker/manager.py", line 515, in _start_worker await self.register_func(worker_run_data) File "/Users/chenzhihan/Desktop/github/DB-GPT/dbgpt/model/cluster/worker/manager.py", line 932, in register_func return await client.register_instance(instance) File "/Users/chenzhihan/Desktop/github/DB-GPT/dbgpt/util/api_utils.py", line 80, in wrapper raise Exception(error_msg) Exception: Remote request error, error code: 502, error msg:

zhangkuo-zk commented 3 months ago

那可能是你的key配置的不对 LLM_MODEL=zhipu_proxyllm PROXY_SERVER_URL=https://open.bigmodel.cn/api/paas/v4/chat/completions ZHIPU_MODEL_VERSION=glm-4 ZHIPU_PROXY_API_KEY={you_key}

ketingli1 commented 3 months ago

已解决 ,url问题

老哥,能详细说下吗,url应该怎么设置

fix,just pip install zhipuai==1.0.7 #1037

没用啊

ketingli1 commented 3 months ago

glm-3-turbo

不对啊,这么配置的,版本也是1.0.7,还是报这个错

aliantony commented 3 months ago

我用docker部署的,dbgpt和dbgpt-allinone都试过了,该问题还存在 INFO: 172.17.0.1:60122 - "POST /api/v1/chat/completions HTTP/1.1" 200 OK 2024-06-07 11:11:32 2024-06-07 11:11:32 bf8f7af6ca1c dbgpt.core.awel.operator.common_operator[858] INFO branch_input_ctxs 0 result None, is_empty: True 2024-06-07 11:11:32 2024-06-07 11:11:32 bf8f7af6ca1c dbgpt.core.awel.operator.common_operator[858] INFO Skip node name llm_model_cache_node 2024-06-07 11:11:32 2024-06-07 11:11:32 bf8f7af6ca1c dbgpt.core.awel.operator.common_operator[858] INFO branch_input_ctxs 1 result True, is_empty: False 2024-06-07 11:11:32 2024-06-07 11:11:32 bf8f7af6ca1c dbgpt.core.awel.runner.local_runner[858] INFO Skip node name llm_model_cache_node, node id 916e1561-4afc-4878-a8ab-096eec7ac54b 2024-06-07 11:11:32 2024-06-07 11:11:32 bf8f7af6ca1c dbgpt.model.adapter.base[858] INFO No conv from model_path zhipu_proxyllm or no messages in params, OldLLMModelAdapterWrapper(dbgpt.model.adapter.old_adapter.ProxyllmAdapter) 2024-06-07 11:11:35 2024-06-07 11:11:35 bf8f7af6ca1c dbgpt.app.scene.base_chat[858] ERROR model response parse failed!local variable 'msg' referenced before assignment

fangyinc commented 3 months ago

使用最新版DB-GPT(目前 v0.5.8)和最新版 zhipuai (目前 zhipuai==2.1.0.20240521)就可以了。

xuanqiang commented 2 months ago

使用DB-GPT(v0.5.8)和最新版zhipuai(目前zhipuai==2.1.2还是不行) 我测了2.1.0.20240521也还是不行呀

xuanqiang commented 2 months ago

选用的模型版本是glm-4-0520 和glm-4

zoey333 commented 3 weeks ago

配置模型版本和api_key时把大括号去掉,可以正常对话。 image