Spaces:
Running
Running
littlebird13
commited on
Commit
β’
ead35e3
1
Parent(s):
cba84bb
Update app.py
Browse files
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,
|