littlebird13 commited on
Commit
ead35e3
β€’
1 Parent(s): cba84bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -1,7 +1,7 @@
1
- import os
2
  import gradio as gr
3
  import modelscope_studio as mgr
4
  from http import HTTPStatus
 
5
  from dashscope import MultiModalConversation
6
  import dashscope
7
  YOUR_API_TOKEN = os.getenv('YOUR_API_TOKEN')
@@ -90,8 +90,9 @@ Qwen2-Audio-Instruct <a href="https://modelscope.cn/models/qwen/Qwen2-Audio-7B-I
90
  # mic = gr.Audio(source="microphone", type="filepath")
91
  user_input = mgr.MultimodalInput(
92
  interactive=True,
93
- sources=['microphone'],
94
- submit_button_props=dict(value="πŸš€ Submit (发送)")
 
95
  )
96
  task_history = gr.State([])
97
 
@@ -99,7 +100,7 @@ Qwen2-Audio-Instruct <a href="https://modelscope.cn/models/qwen/Qwen2-Audio-7B-I
99
  empty_bin = gr.Button("🧹 Clear History (ζΈ…ι™€εŽ†ε²)")
100
  # submit_btn = gr.Button("πŸš€ Submit (发送)")
101
  regen_btn = gr.Button("πŸ€”οΈ Regenerate (重试)")
102
- addfile_btn = gr.UploadButton("πŸ“ Upload (δΈŠδΌ ζ–‡δ»Ά)", file_types=["audio"])
103
 
104
  # mic.change(add_mic, [chatbot, task_history, mic], [chatbot, task_history])
105
  # submit_btn.click(add_text, [chatbot, task_history, query], [chatbot, task_history]).then(
@@ -114,7 +115,7 @@ Qwen2-Audio-Instruct <a href="https://modelscope.cn/models/qwen/Qwen2-Audio-7B-I
114
  )
115
  empty_bin.click(reset_state, outputs=[chatbot, task_history], show_progress=True)
116
  regen_btn.click(regenerate, [chatbot, task_history], [chatbot, task_history], show_progress=True)
117
- addfile_btn.upload(add_file, [chatbot, task_history, addfile_btn], [chatbot, task_history], show_progress=True)
118
 
119
  demo.queue().launch(
120
  share=False,
 
 
1
  import gradio as gr
2
  import modelscope_studio as mgr
3
  from http import HTTPStatus
4
+ import os
5
  from dashscope import MultiModalConversation
6
  import dashscope
7
  YOUR_API_TOKEN = os.getenv('YOUR_API_TOKEN')
 
90
  # mic = gr.Audio(source="microphone", type="filepath")
91
  user_input = mgr.MultimodalInput(
92
  interactive=True,
93
+ sources=['microphone', 'upload'],
94
+ submit_button_props=dict(value="πŸš€ Submit (发送)"),
95
+ upload_button_props=dict(value="πŸ“ Upload (δΈŠδΌ ζ–‡δ»Ά)", show_progress=True),
96
  )
97
  task_history = gr.State([])
98
 
 
100
  empty_bin = gr.Button("🧹 Clear History (ζΈ…ι™€εŽ†ε²)")
101
  # submit_btn = gr.Button("πŸš€ Submit (发送)")
102
  regen_btn = gr.Button("πŸ€”οΈ Regenerate (重试)")
103
+ # addfile_btn = gr.UploadButton("πŸ“ Upload (δΈŠδΌ ζ–‡δ»Ά)", file_types=["audio"])
104
 
105
  # mic.change(add_mic, [chatbot, task_history, mic], [chatbot, task_history])
106
  # submit_btn.click(add_text, [chatbot, task_history, query], [chatbot, task_history]).then(
 
115
  )
116
  empty_bin.click(reset_state, outputs=[chatbot, task_history], show_progress=True)
117
  regen_btn.click(regenerate, [chatbot, task_history], [chatbot, task_history], show_progress=True)
118
+ # addfile_btn.upload(add_file, [chatbot, task_history, addfile_btn], [chatbot, task_history], show_progress=True)
119
 
120
  demo.queue().launch(
121
  share=False,