Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

工具调用幻觉严重 #170

Open
v-yunbin opened this issue Mar 6, 2024 · 0 comments
Open

工具调用幻觉严重 #170

v-yunbin opened this issue Mar 6, 2024 · 0 comments

Comments

@v-yunbin
Copy link

v-yunbin commented Mar 6, 2024

自定义了一个天气查询的工具,模型没有调用我的工具,而是瞎掰了一个:

用户:北京市今天天气怎么样

InternLm2:/home/ybZhang/miniconda3/envs/lagent/lib/python3.10/site-packages/transformers/generation/configuration_utils.py:410: UserWarning: `do_sample` is set to `False`. However, `temperature` is set to `0.1` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `temperature`.
  warnings.warn(
/home/ybZhang/miniconda3/envs/lagent/lib/python3.10/site-packages/transformers/generation/configuration_utils.py:415: UserWarning: `do_sample` is set to `False`. However, `top_p` is set to `0.8` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `top_p`.
  warnings.warn(

好的,我将使用一个API来获取北京市今天的天气信息。请稍等片刻

python
import requests

def get_weather():
    url = "http://api.weather.com/get_weather"
    params = {
        "city": "北京市",
        "date": "today"
    }
    response = requests.get(url, params=params)
    weather = response.json()
    return weather

weather = get_weather()
print(weather)
`Traceback (most recent call last):
  File "/data/disk2/ybZhang/Chinese-LLM-Chat/agent/lagent/examples/internlm2_agent_cli_demo.py", line 99, in <module>
    main()
  File "/data/disk2/ybZhang/Chinese-LLM-Chat/agent/lagent/examples/internlm2_agent_cli_demo.py", line 73, in main
    for agent_return in chatbot.stream_chat(history):
  File "/data/disk2/ybZhang/Chinese-LLM-Chat/agent/lagent/lagent/agents/internlm2_agent.py", line 342, in stream_chat
    action_return: ActionReturn = executor(action['name'],
UnboundLocalError: local variable 'executor' referenced before assignment
@v-yunbin v-yunbin changed the title 如何注册新的tool? 工具调用幻觉严重 Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant