gpt_academic icon indicating copy to clipboard operation
gpt_academic copied to clipboard

[Bug]: 配置了模型,但是提示未配置

Open WingGao opened this issue 10 months ago • 1 comments

Installation Method | 安装方法与平台

Docker(Linux)

Version | 版本

Latest | 最新版

OS | 操作系统

Docker

Describe the bug | 简述

启动日志

13:41 | ..v_variable:60  | [ENV_VAR] 成功读取环境变量API_URL_REDIRECT
13:41 | ..v_variable:33  | [ENV_VAR] 尝试加载AVAIL_LLM_MODELS,默认值:['qwen-max', 'o1-mini', 'o1-mini-2024-09-12', 'o1', 'o1-2024-12-17', 'o1-preview', 'o1-preview-2024-09-12', 'gpt-4-1106-preview', 'gpt-4-turbo-preview', 'gpt-4-vision-preview', 'gpt-4o', 'gpt-4o-mini', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo', 'azure-gpt-3.5', 'gpt-4', 'gpt-4-32k', 'azure-gpt-4', 'glm-4', 'glm-4v', 'glm-3-turbo', 'gemini-1.5-pro', 'chatglm3', 'chatglm4', 'deepseek-chat', 'deepseek-coder', 'deepseek-reasoner', 'volcengine-deepseek-r1-250120', 'volcengine-deepseek-v3-241226'] --> 修正值:["gpt-4o-mini","gpt-4o-2024-08-06"]
13:41 | ..v_variable:60  | [ENV_VAR] 成功读取环境变量AVAIL_LLM_MODELS
13:41 | ..v_variable:33  | [ENV_VAR] 尝试加载LLM_MODEL,默认值:gpt-3.5-turbo-16k --> 修正值:gpt-4o-mini

但是报错

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/gradio/routes.py", line 422, in run_predict
    output = await app.get_blocks().process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gradio/blocks.py", line 1323, in process_api
    result = await self.call_function(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gradio/blocks.py", line 1067, in call_function
    prediction = await utils.async_iteration(iterator)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gradio/utils.py", line 336, in async_iteration
    return await iterator.__anext__()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gradio/utils.py", line 329, in __anext__
    return await anyio.to_thread.run_sync(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2461, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 962, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gradio/utils.py", line 312, in run_sync_iterator_async
    return next(iterator)
           ^^^^^^^^^^^^^^
  File "/gpt/toolbox.py", line 136, in decorated
    yield from f(txt_passon, llm_kwargs, plugin_kwargs, chatbot_with_cookie, history, system_prompt, *args)
  File "/gpt/request_llms/bridge_all.py", line 1457, in predict
    method = model_info[llm_kwargs['llm_model']]["fn_with_ui"]  # 如果这里报错,检查config中的AVAIL_LLM_MODELS选项
             ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'gpt-4o-2024-08-06'

Screen Shot | 有帮助的截图

None

Terminal Traceback & Material to Help Reproduce Bugs | 终端traceback(如有) + 帮助我们复现的测试材料样本(如有)

No response

WingGao avatar Mar 07 '25 06:03 WingGao

不存在模型 gpt-4o-2024-08-06

https://github.com/binary-husky/gpt_academic/blob/045cdb15d86c262a55ede6dd9c84a5ab63dcc797/request_llms/bridge_all.py#L119-L353

SakuraPuare avatar Mar 20 '25 17:03 SakuraPuare