het-25 / st-multimodal-chatinput

Streamlit component that allows you to accept multi-modal inputs through a chat interface.
MIT License
45 stars 10 forks source link

Trouble starting it in streamlit #3

Open leiwu0227 opened 4 months ago

leiwu0227 commented 4 months ago

Hi,

Thanks for the package, I am having some difficulty getting it to work.

After installed using pip install st_multimodal_chatinput, I am having the following error while running.

File "path\bot.py", line 135, in test=multimodal_chatinput() File "path\anaconda3\lib\site-packages\st_multimodal_chatinput__init__.py", line 56, in multimodal_chatinput if 'uploadedFiles' in component_value


it seems that the following code in the init folder is returning None.

component_value = _component_func(disabled=disabled, default=default)

# Ensure backward compatibility for uploadedImages
if 'uploadedFiles' in component_value:
    component_value['uploadedImages'] = [
        file['content'] for file in component_value['uploadedFiles']
        if file['type'].startswith('image/')
    ]
leiwu0227 commented 4 months ago

my python version is 3.9.18

shubhamgarg21 commented 4 months ago

same here

het-25 commented 4 months ago

Should be fixed in the newer release. Please upgrade the package and try again - do let me know if you run into the same issue.

pandachen7 commented 3 months ago

Not work with messages as below

2024-08-14 09:32:38.389 Uncaught app exception
Traceback (most recent call last):
  File "/home/test/ws/venv/llm310/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 85, in exec_func_with_error_handling
    result = func()
  File "/home/test/ws/venv/llm310/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 576, in code_to_exec
    exec(code, module.__dict__)
  File "/home/test/ws/hug_face/st_lit/st_upload.py", line 7, in <module>
    uploaded_files = chatinput["uploadedFiles"] ##list of ALL uploaded files (including images) along with type, name, and content.
TypeError: 'NoneType' object is not subscriptable

My python version is 3.10.14, and other packages are streamlit==1.37.1 st-multimodal-chatinput==0.2.1