modelscope / modelscope-studio

Apache License 2.0
38 stars 5 forks source link

UnicodeDecodeError: 'gbk' codec can't decode byte 0x81 in position 5795: illegal multibyte sequence #11

Closed passerby-bye closed 6 months ago

passerby-bye commented 6 months ago
Traceback (most recent call last):
  File "E:\00soup_iface\main.py", line 1, in <module>
    import modelscope_studio
  File "C:\Users\Administrator\modelscope-studio\backend\modelscope_studio\__init__.py", line 5, in <module>
    from .components.WaterfallGallery import \
  File "C:\Users\Administrator\modelscope-studio\backend\modelscope_studio\components\WaterfallGallery\__init__.py", line 38, in <module>
    class ModelScopeWaterfallGallery(Component):
  File "E:\Anaconda\envs\agentscope\lib\site-packages\gradio\component_meta.py", line 198, in __new__
    create_or_modify_pyi(component_class, name, events)
  File "E:\Anaconda\envs\agentscope\lib\site-packages\gradio\component_meta.py", line 92, in create_or_modify_pyi
    source_code = source_file.read_text()
  File "E:\Anaconda\envs\agentscope\lib\pathlib.py", line 1136, in read_text
    return f.read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0x81 in position 5795: illegal multibyte sequence

System Information

OS: Windows Python version:3.10 modelscope_studio:0.1.4 gradio:4.21.0

A probably Slove method

The default encoding mode of the Windows system is 'gbk', and you need to specify the decoding mode as 'utf-8'. gradio->component_meta.py->line 92 source_code = source_file.read_text(encoding='utf-8')

Col0ring commented 6 months ago

Thank you for bringing this to our attention, but it seems that the error is not directly caused by modelscope_studio.

We've Integrated some tools from gradio to create custom components, and it seems the issue lies within these. It would be better to report this issue in the gradio repo and we'll follow up on it.

Yfcan commented 6 months ago
8c6a11de0fbfa835fde1c42d3ef2b4a

一样的问题

cjyyx commented 6 months ago

+1

Col0ring commented 6 months ago

~Thank you for bringing this to our attention, but it seems that the error is not directly caused by modelscope_studio.~ ~We've Integrated some tools from gradio to create custom components, and it seems the issue lies within these. It would be better to report this issue in the gradio repo and we'll follow up on it.~

We found the reason and have fixed it in modelscope_studio@0.1.5. Thanks again!