binary-husky / binary-husky/gpt_academic

[Bug]: 连接超时,显示KeyError: 'gpt-4o-mini'

Open
#2,010 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
71.4k
Forks
8.3k
PR merge metrics
No merged PRs in 30d

Description

### Installation Method | 安装方法与平台

Docker-Compose(Windows/Mac)

### Version | 版本

Latest | 最新版

### OS | 操作系统

Mac

### Describe the bug | 简述

连接超时,显示KeyError: 'gpt-4o-mini',换用gpt-4o 或 gpt-3.5-turbo可以正常运行

配置:
`docker-compose`中:
```
LLM_MODEL: ' gpt-4o-mini '
AVAIL_LLM_MODELS: ' ["gpt-4o-mini", "gpt-4o", "gpt-3.5-turbo"]
```
`config.py`中:
```
LLM_MODEL = "gpt-4o-mini" # 可选 ↓↓↓
AVAIL_LLM_MODELS = ["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"
]
```

### Screen Shot | 有帮助的截图

image

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

```
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 2177, in run_sync_in_worker_thread
return await future
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, 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 129, 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 1131, in predict
method = model_info[llm_kwargs['llm_model']]["fn_with_ui"] # 如果这里报错,检查config中的AVAIL_LLM_MODELS选项
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'gpt-4o-mini'
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with gpt/request_llms/bridge_all.py at line 1131 and compare the requested model with the entries from config.py and the docker-compose environment. Reproduce with LLM_MODEL set to gpt-4o-mini, then verify the request no longer raises KeyError and that the existing gpt-4o and gpt-3.5-turbo paths still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker-compose, python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.