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

[BUG] WebDemo中使用Few Shot功能,如果不传图片无法正常使用 #658

Open
2 tasks done
gongjimin opened this issue Nov 7, 2024 · 0 comments
Open
2 tasks done

Comments

@gongjimin
Copy link

是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?

  • 我已经搜索过已有的issues和讨论 | I have searched the existing issues / discussions

该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?

  • 我已经搜索过FAQ | I have searched FAQ

当前行为 | Current Behavior

在WebDemo2.6中使用Few Shot功能,如果不传图片,生成时页面报错。

期望行为 | Expected Behavior

正常看到经过Few Shot学习后的回答内容

复现方法 | Steps To Reproduce

使用web_demo_2.6.py加载int4模型,打开页面后切换到Frew Shot页签。填写用户问题和助手回答,但是不上传图片,点击add example,然后再次填写用户问题,点击Generate.

运行环境 | Environment

无关

备注 | Anything else?

查看日志能看到是格式校验错误。

msgs: [{'role': 'user', 'content': ['你是谁?']}, {'role': 'assistant', 'content': ['我是XXX']}]
answer: 你好!我是XXX,一个由OpenAI训练的大型语言模型。我被设计用来理解和生成自然语言文本,并可以回答各种问题或参与对话。今天有什么我可以帮助你的吗?
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/gradio/queueing.py", line 624, in process_events
    response = await route_utils.call_process_api(
  File "/usr/local/lib/python3.10/dist-packages/gradio/route_utils.py", line 323, in call_process_api
    output = await app.get_blocks().process_api(
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 2028, in process_api
    data = await self.postprocess_data(block_fn, result["prediction"], state)
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1834, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "/usr/local/lib/python3.10/dist-packages/modelscope_studio/components/Chatbot/__init__.py", line 351, in postprocess
    list)) else self._postprocess_chat_messages(message))
  File "/usr/local/lib/python3.10/dist-packages/modelscope_studio/components/Chatbot/__init__.py", line 285, in _postprocess_chat_messages
    chat_message = MultimodalMessage(**chat_message)
  File "/usr/local/lib/python3.10/dist-packages/pydantic/main.py", line 212, in __init__
    validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 4 validation errors for MultimodalMessage
files.0.FileMessage
  Input should be a valid dictionary or instance of FileMessage [type=model_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.9/v/model_type
files.0.dict[any,any]
  Input should be a valid dictionary [type=dict_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.9/v/dict_type
files.0.FileData
  Input should be a valid dictionary or instance of FileData [type=model_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.9/v/model_type
files.0.str
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.9/v/string_type
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