You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import streamlit as st
from audiorecorder import audiorecorder
import whisper
# st.title("Audio Recorder")
# if 'audio' not in st.session_state:
# st.session_state.audio = None
# 使用录音组件
audio1 = audiorecorder("Click to record", "Click to stop recording", key='1')
# 检查是否录音完成
# if audio:
# st.session_state.audio = audio
# print(type(audio))
# # 在前端播放音频
# st.audio(audio.export().read())
# # 保存音频
# audio.export("/mnt/workspace/projects/whisper/audio.wav", format="wav")
# # 加载模型并进行转录
# model = whisper.load_model("/mnt/workspace/projects/whisper/base.pt")
# result = model.transcribe("/mnt/workspace/projects/whisper/audio.wav")
# answer = result["text"]
# print('answer:', answer)
# st.write('Transcription:', answer)
but in a cluster server there is a ERROR
Traceback (most recent call last):
File "/root/anaconda3/envs/langchain/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
exec(code, module.dict)
File "/mnt/workspace/projects/Langchain-Chatchat/tests/whisper.py", line 11, in
audio1 = audiorecorder("Click to record", "Click to stop recording", key='1')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/langchain/lib/python3.11/site-packages/audiorecorder/init.py", line 25, in audiorecorder
base64_audio = _component_func(start_prompt=start_prompt, stop_prompt=stop_prompt, pause_prompt=pause_prompt, show_visualizer=show_visualizer, key=key, default=b"")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/langchain/lib/python3.11/site-packages/streamlit/components/v1/components.py", line 80, in call
return self.create_instance(*args, default=default, key=key, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/langchain/lib/python3.11/site-packages/streamlit/runtime/metrics_util.py", line 396, in wrapped_func
result = non_optional_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/langchain/lib/python3.11/site-packages/streamlit/components/v1/components.py", line 241, in create_instance
return_value = marshall_component(dg, element)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/langchain/lib/python3.11/site-packages/streamlit/components/v1/components.py", line 212, in marshall_component
component_state = register_widget(
^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/langchain/lib/python3.11/site-packages/streamlit/runtime/state/widgets.py", line 161, in register_widget
return register_widget_from_metadata(metadata, ctx, widget_func_name, element_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/langchain/lib/python3.11/site-packages/streamlit/runtime/state/widgets.py", line 194, in register_widget_from_metadata
raise DuplicateWidgetID(
streamlit.errors.DuplicateWidgetID: There are multiple widgets with the same key='1'.
The text was updated successfully, but these errors were encountered:
I can run this in my PC
but in a cluster server there is a ERROR
Traceback (most recent call last):
File "/root/anaconda3/envs/langchain/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
exec(code, module.dict)
File "/mnt/workspace/projects/Langchain-Chatchat/tests/whisper.py", line 11, in
audio1 = audiorecorder("Click to record", "Click to stop recording", key='1')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/langchain/lib/python3.11/site-packages/audiorecorder/init.py", line 25, in audiorecorder
base64_audio = _component_func(start_prompt=start_prompt, stop_prompt=stop_prompt, pause_prompt=pause_prompt, show_visualizer=show_visualizer, key=key, default=b"")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/langchain/lib/python3.11/site-packages/streamlit/components/v1/components.py", line 80, in call
return self.create_instance(*args, default=default, key=key, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/langchain/lib/python3.11/site-packages/streamlit/runtime/metrics_util.py", line 396, in wrapped_func
result = non_optional_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/langchain/lib/python3.11/site-packages/streamlit/components/v1/components.py", line 241, in create_instance
return_value = marshall_component(dg, element)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/langchain/lib/python3.11/site-packages/streamlit/components/v1/components.py", line 212, in marshall_component
component_state = register_widget(
^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/langchain/lib/python3.11/site-packages/streamlit/runtime/state/widgets.py", line 161, in register_widget
return register_widget_from_metadata(metadata, ctx, widget_func_name, element_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/langchain/lib/python3.11/site-packages/streamlit/runtime/state/widgets.py", line 194, in register_widget_from_metadata
raise DuplicateWidgetID(
streamlit.errors.DuplicateWidgetID: There are multiple widgets with the same
key='1'
.The text was updated successfully, but these errors were encountered: