InternLM / InternLM/Tutorial

天气agent的问题,无输出

Đang mở
#288 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
2k
Fork
1.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

我跑了范例,发现没有输出。然后我进行debug。 debug到这个信息,麻烦指点一下,为什么actionReturn 一个 NoAction?

前面输出正常
![image](https://github.com/InternLM/tutorial/assets/1407300/55ec92c8-0146-4b6d-8945-511939def1cc)

后面action出错
![image](https://github.com/InternLM/tutorial/assets/1407300/cf0ae678-5a1d-4c6e-847b-b0d0d84626dd)

debug位置
![image](https://github.com/InternLM/tutorial/assets/1407300/562f91a5-486c-445c-b3ce-9f6cfef0e8f5)

### 感觉adapter有问题,
比如 prompt如下:
[{'role': 'system', 'content': "你是一个可以调用外部工具的助手,可以使用的工具包括:\n{'GoogleSearch': '一个可以从谷歌搜索结果的API。\\n当你需要对于一个特定问题找到简短明了的回答时,可以使用它。\\n输入应该是一个搜索查询。\\n'}\n如果使用工具请遵循以下格式回复:\n```\nThought:思考你当前步骤需要解决什么问题,是否需要使用工具\nAction:工具名称,你的工具必须从 [['GoogleSearch']] 选择\nAction Input:工具输入参数\n```\n工具返回按照以下格式回复:\n```\nResponse:调用工具后的结果\n```\n如果你已经知道了答案,或者你不需要工具,请遵循以下格式回复\n```\nThought:给出最终答案的思考过程\nFinal Answer:最终答案\n```\n开始!"}, {'role': 'user', 'content': '深圳明天的天气?'}]

模型会回应如下:
"Thought:我需要查询天气预报API来回答这个问题。\nAction:forecast_weather\nAction Input:{'location': '深圳', 'days': 1}}"

追踪到lagent/actions/action_executor.py 发现forecast_weather不合法, 程序只能接受GoogleSearch,也就是说模型不给出GoogleSearch的action就无法获得结果。 到了react.py chat第4轮, 如果action是 NoAction,那么就会得到空值。 如果没有在4轮以内收到action是FinishAction,那么得到一个default_response,无法回答问题。

感觉debug差不多了, 估计要麻烦老师看一下魔搭的adapter了。

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.