24.8.11Langchain实战项目:智能论文审稿机器人下-此莫 基德老师- 报错 #477

Open
opened 2025-01-16 14:51:20 +08:00 by 21825813947cs · 3 comments

错误详细信息见附件。
1、在读取本地文件进行智能审稿的时候,httpx.HTTPStatusError: Client error '429 Too Many Requests' for url ,估计是GLM有限制。

2、fastchat部署后,测试时报错。
root@zf4909066b964784aa197ec174fed0d1-task0-0:/# curl http://localhost:8000/v1/completions -H "Content-Type: application/json" -d '{

"model": "glm-4-9b-chat",
"prompt": "Once upon a time",
"max_tokens": 41,
"temperature": 0.5}'

Internal Server Error

错误详细信息见附件。 1、在读取本地文件进行智能审稿的时候,httpx.HTTPStatusError: Client error '429 Too Many Requests' for url ,估计是GLM有限制。 2、fastchat部署后,测试时报错。 root@zf4909066b964784aa197ec174fed0d1-task0-0:/# curl http://localhost:8000/v1/completions -H "Content-Type: application/json" -d '{ > "model": "glm-4-9b-chat", > "prompt": "Once upon a time", > "max_tokens": 41, > "temperature": 0.5}' Internal Server Error
21825813947cs changed title from 11.3-LLaMA-factory 微调医疗数据集,FastGPT 部署模型应用(下)-林希老师- 报错 to 24.8.11Langchain实战项目:智能论文审稿机器人下-此莫 基德老师- 报错 2025-01-16 14:52:25 +08:00

第一个问题:可以在每次 API 调用之间增加延迟(例如 time.sleep()),以减少请求频率;登录智谱 AI 的控制台,检查当前 API 的调用配额和速率限制。
第二个问题:ChatGLMForConditionalGeneration 模型类中没有 stream_generate 方法,导致在调用时抛出异常。如果 ChatGLM 不支持流式生成(stream_generate),可以使用 generate 方法替代 stream_generate。
TypeError: string indices must be integers 问题原因:在 fastchat/serve/openai_api_server.py 中,content 被当作字典处理,但实际上它是一个字符串。解决方案:检查 content 的来源,确保它是一个 JSON 对象(字典),而不是字符串。如果 content 是字符串,需要使用 json.loads 将其解析为字典。

第一个问题:可以在每次 API 调用之间增加延迟(例如 time.sleep()),以减少请求频率;登录智谱 AI 的控制台,检查当前 API 的调用配额和速率限制。 第二个问题:ChatGLMForConditionalGeneration 模型类中没有 stream_generate 方法,导致在调用时抛出异常。如果 ChatGLM 不支持流式生成(stream_generate),可以使用 generate 方法替代 stream_generate。 TypeError: string indices must be integers 问题原因:在 fastchat/serve/openai_api_server.py 中,content 被当作字典处理,但实际上它是一个字符串。解决方案:检查 content 的来源,确保它是一个 JSON 对象(字典),而不是字符串。如果 content 是字符串,需要使用 json.loads 将其解析为字典。
Author

这两个问题我还是没解决:
第一个问题:
我修改了
for d in my_docs:
docs.add(path=d, chunk_chars=300, disable_check=True)
time.sleep(120)
可是依然报错。
第二个问题:
我严格按照课件操作# curl http://localhost:8000/v1/completions -H "Content-Type: application/json" -d '{

"model": "glm-4-9b-chat",
"prompt": "Once upon a time",
"max_tokens": 41,
"temperature": 0.5}'

这里的content应该是指"Once upon a time"吧?是课件有问题么?

这两个问题我还是没解决: 第一个问题: 我修改了 for d in my_docs: docs.add(path=d, chunk_chars=300, disable_check=True) time.sleep(120) 可是依然报错。 第二个问题: 我严格按照课件操作# curl http://localhost:8000/v1/completions -H "Content-Type: application/json" -d '{ "model": "glm-4-9b-chat", "prompt": "Once upon a time", "max_tokens": 41, "temperature": 0.5}' 这里的content应该是指"Once upon a time"吧?是课件有问题么?
Author

我看到bigmodel.cn上的GLM-4速率限制主要是指并发数限制,现在是30,我现在是免费级别,调整不了这个参数。

我看到bigmodel.cn上的GLM-4速率限制主要是指并发数限制,现在是30,我现在是免费级别,调整不了这个参数。
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: HswOAuth/llm_course#477
No description provided.