tzzte commited on
Commit
1d67e42
·
verified ·
1 Parent(s): c5f1fa0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -105,11 +105,11 @@ def process_audio_text(audio):
105
 
106
  if audio_data is not None:
107
  sr, audio_array = audio_data
108
- yield accumulated_text, (sr, audio_array)
109
  else:
110
- yield accumulated_text, None
111
  except Exception as e:
112
- yield f"Error: {str(e)}", None
113
  finally:
114
  # 清理临时文件
115
  if audio_path and audio_path != audio and os.path.exists(audio_path):
@@ -141,4 +141,4 @@ if __name__ == "__main__":
141
  allow_flagging="never"
142
  )
143
 
144
- iface.launch(server_name="0.0.0.0", server_port=7860, share=True)
 
105
 
106
  if audio_data is not None:
107
  sr, audio_array = audio_data
108
+ yield (sr, audio_array), accumulated_text
109
  else:
110
+ yield None, accumulated_text
111
  except Exception as e:
112
+ yield None, f"Error: {str(e)}"
113
  finally:
114
  # 清理临时文件
115
  if audio_path and audio_path != audio and os.path.exists(audio_path):
 
141
  allow_flagging="never"
142
  )
143
 
144
+ iface.launch(server_name="0.0.0.0", server_port=7860, share=False)