Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -228,25 +228,25 @@ def function(Textbox, Textbox2, Textbox3, Dropdown):
|
|
228 |
else:
|
229 |
return "Failed"
|
230 |
|
231 |
-
inputs = [
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
]
|
238 |
-
|
239 |
-
def audio_format(data):
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
# outputs = gr.outputs.Image(type="numpy")
|
244 |
-
outputs = gr.outputs.Textbox() if Dropdown == "Option1" else gr.outputs.Audio(type="bytes", label="Audio Output", format="mp3")
|
245 |
-
|
246 |
-
|
247 |
-
iface = gr.Interface(fn=function, inputs=inputs, outputs=outputs)
|
248 |
-
|
249 |
-
iface.launch()
|
250 |
|
251 |
|
252 |
|
|
|
228 |
else:
|
229 |
return "Failed"
|
230 |
|
231 |
+
inputs = [
|
232 |
+
gr.inputs.Textbox(label="Textbox", type="text"),
|
233 |
+
gr.inputs.Textbox(label="Textbox2", type="text"),
|
234 |
+
gr.inputs.Textbox(label="Textbox3", type="password"),
|
235 |
+
gr.inputs.Dropdown(["Option1", "Option2"], label="Dropdown")
|
236 |
+
|
237 |
+
]
|
238 |
+
|
239 |
+
def audio_format(data):
|
240 |
+
audio = AudioSegment.from_file(BytesIO(data), format="mp3")
|
241 |
+
return audio
|
242 |
+
|
243 |
+
# outputs = gr.outputs.Image(type="numpy")
|
244 |
+
outputs = gr.outputs.Textbox() if Dropdown == "Option1" else gr.outputs.Audio(type="bytes", label="Audio Output", format="mp3")
|
245 |
+
|
246 |
+
|
247 |
+
iface = gr.Interface(fn=function, inputs=inputs, outputs=outputs)
|
248 |
+
|
249 |
+
iface.launch()
|
250 |
|
251 |
|
252 |
|