GaiZhenbiao / ChuanhuChatGPT

GUI for ChatGPT API and many LLMs. Supports agents, file-based QA, GPT finetuning and query with web search. All with a neat UI.
https://huggingface.co/spaces/JohnSmith9982/ChuanhuChatGPT
GNU General Public License v3.0
15.15k stars 2.29k forks source link

[Bug]: 上传图片显示Error #460

Closed NekoYu closed 1 year ago

NekoYu commented 1 year ago

这个bug是否已存在现有issue了?

错误表现

使用GPT-4模型,上传图片后提问显示“索引构建完成,获取回答中……”,左侧有红色Error

复现操作

1.服务器docker部署 2.上传图片 3.提问

错误日志

To create a public link, set `share=True` in `launch()`.
2023-03-29 13:03:32,618 [INFO] [chat_func.py:252] 输入为:这张图片的笑点是什么
2023-03-29 13:03:32,634 [INFO] [chat_func.py:259] 加载索引中……(这可能需要几分钟)
/root/.local/lib/python3.9/site-packages/langchain/llms/openai.py:169: UserWarning: You are trying to use a chat model. This way of initializing it is no longer supported. Instead, please use: `from langchain.chat_models import ChatOpenAI`
  warnings.warn(
/root/.local/lib/python3.9/site-packages/langchain/llms/openai.py:608: UserWarning: You are trying to use a chat model. This way of initializing it is no longer supported. Instead, please use: `from langchain.chat_models import ChatOpenAI`
  warnings.warn(
2023-03-29 13:03:34,333 [INFO] [llama_func.py:37] loading file: /tmp/4b5a17e12de8512fab0624d0061dcc7e103ee0f1/F6F7A6DEAC97D66F5B4131B16475967F.png
'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
2023-03-29 13:03:34,347 [INFO] [llama_func.py:119] Question: 这张图片的笑点是什么
Traceback (most recent call last):
  File "/root/.local/lib/python3.9/site-packages/gradio/routes.py", line 394, in run_predict
    output = await app.get_blocks().process_api(
  File "/root/.local/lib/python3.9/site-packages/gradio/blocks.py", line 1075, in process_api
    result = await self.call_function(
  File "/root/.local/lib/python3.9/site-packages/gradio/blocks.py", line 898, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/root/.local/lib/python3.9/site-packages/anyio/to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/root/.local/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "/root/.local/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "/root/.local/lib/python3.9/site-packages/gradio/utils.py", line 549, in async_iteration
    return next(iterator)
  File "/app/modules/chat_func.py", line 264, in predict
    history, chatbot, status_text = chat_ai(openai_api_key, index, inputs, history, chatbot, reply_language)
  File "/app/modules/llama_func.py", line 121, in chat_ai
    response, chatbot_display, status_text = ask_ai(
  File "/app/modules/llama_func.py", line 171, in ask_ai
    response = index.query(
AttributeError: 'NoneType' object has no attribute 'query'

运行环境

- OS: Ubuntu 18.04
- Browser: Edge dev
- Gradio version: 3.23.0 
- Python version: 3.9.16

补充说明

No response

NekoYu commented 1 year ago

Commit: c8fd9d2

MZhao-ouo commented 1 year ago

一、川虎ChatGPT目前不支持图片识别,也不支持上传图片 二、目前能够测试的只有GPT-4 的8k文字版本,不支持多模态,等到拿到相应api后会马上跟进