riffusion / riffusion-hobby

Stable diffusion for real-time music generation
MIT License
3.39k stars 389 forks source link

streamlit should be pinned to 1.17.0 #129

Closed wesleygriffin closed 1 year ago

wesleygriffin commented 1 year ago

The requirements.txt file specifies a streamlit package version of >=1.10.0. As of 1.17.0, the APIs that Riffusion are using have been deprecated. More importantly, however, there appears to have been an API change that results in this error:

2023-03-23 19:56:46.928 Uncaught app exception
Traceback (most recent call last):
  File "/Users/wgriffin/Active/riffusion/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/Users/wgriffin/Active/riffusion/riffusion/streamlit/pages/audio_to_audio.py", line 414, in <module>
    render_audio_to_audio()
  File "/Users/wgriffin/Active/riffusion/riffusion/streamlit/pages/audio_to_audio.py", line 18, in render_audio_to_audio
    st.set_page_config(layout="wide", page_icon="🎸")
  File "/Users/wgriffin/Active/riffusion/venv/lib/python3.9/site-packages/streamlit/runtime/metrics_util.py", line 311, in wrapped_func
    result = non_optional_func(*args, **kwargs)
  File "/Users/wgriffin/Active/riffusion/venv/lib/python3.9/site-packages/streamlit/commands/page_config.py", line 225, in set_page_config
    ctx.enqueue(msg)
  File "/Users/wgriffin/Active/riffusion/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_run_context.py", line 91, in enqueue
    raise StreamlitAPIException(
streamlit.errors.StreamlitAPIException: `set_page_config()` can only be called once per app, and must be called as the first Streamlit command in your script.

Also, 1.10.0 doesn't understand type for form_submit_button():

2023-03-23 19:59:45.537 Uncaught app exception
Traceback (most recent call last):
  File "/Users/wgriffin/Active/riffusion/venv/lib/python3.9/site-packages/streamlit/scriptrunner/script_runner.py", line 554, in _run_script
    exec(code, module.__dict__)
  File "riffusion/streamlit/pages/text_to_audio.py", line 125, in <module>
    render_text_to_audio()
  File "riffusion/streamlit/pages/text_to_audio.py", line 57, in render_text_to_audio
    st.form_submit_button("Riff", type="primary")
TypeError: form_submit_button() got an unexpected keyword argument 'type'

It appears that 1.17.0 is a working version.

wesleygriffin commented 1 year ago

PR: https://github.com/riffusion/riffusion/pull/130

ianberman commented 1 year ago

Same issue. PR seems to have fixed it. +1

hmartiro commented 1 year ago

I've updated the app and requirements to Streamlit >= 1.18