Spaces:
Runtime error
Runtime error
small fix for gpt3
Browse files
32.wav
ADDED
Binary file (300 kB). View file
|
|
99.jpg
ADDED
app.py
CHANGED
@@ -248,7 +248,7 @@ def process_and_query(text=None):
|
|
248 |
]
|
249 |
)
|
250 |
final_response= completion.choices[0].message.content
|
251 |
-
return
|
252 |
except Exception as e:
|
253 |
return str(e)
|
254 |
|
|
|
248 |
]
|
249 |
)
|
250 |
final_response= completion.choices[0].message.content
|
251 |
+
return final_response
|
252 |
except Exception as e:
|
253 |
return str(e)
|
254 |
|
test.py
CHANGED
@@ -1,7 +1,35 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
def process_image(audio):
|
4 |
-
return str(len(audio))
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
|
|
|
|
3 |
|
4 |
+
def process_text(text):
|
5 |
+
return text
|
6 |
+
|
7 |
+
|
8 |
+
def process_image(image):
|
9 |
+
return "image processed successfully"
|
10 |
+
|
11 |
+
def process_audio(audio):
|
12 |
+
return "audio processed successfully"
|
13 |
+
|
14 |
+
|
15 |
+
with gr.Blocks() as iface:
|
16 |
+
gr.Markdown("# this is my demo for tab feature")
|
17 |
+
with gr.Tab("process Text"):
|
18 |
+
text_input = gr.Textbox()
|
19 |
+
text_output = gr.Textbox()
|
20 |
+
text_button = gr.Button("process text")
|
21 |
+
with gr.Tab("process Image"):
|
22 |
+
image_input = gr.Image()
|
23 |
+
image_output = gr.Textbox()
|
24 |
+
image_button = gr.Button("process image")
|
25 |
+
with gr.Tab("process Audio"):
|
26 |
+
audio_input = gr.Audio()
|
27 |
+
audio_output = gr.Textbox()
|
28 |
+
audio_button = gr.Button("process audio")
|
29 |
+
|
30 |
+
|
31 |
+
text_button.click(process_text, inputs=text_input, outputs=text_output)
|
32 |
+
image_button.click(process_image, inputs=image_input, outputs=image_output)
|
33 |
+
audio_button.click(process_audio, inputs=audio_input, outputs=audio_output)
|
34 |
+
|
35 |
iface.launch()
|