Update app.py
Browse files
app.py
CHANGED
|
@@ -1,28 +1,21 @@
|
|
| 1 |
-
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
# Extract string parameters
|
| 15 |
-
param1 = request.form.get('param1', '')
|
| 16 |
-
param2 = request.form.get('param2', '')
|
| 17 |
-
|
| 18 |
-
# Example processing logic
|
| 19 |
-
response = {
|
| 20 |
-
'message': 'File received',
|
| 21 |
-
'param1': param1,
|
| 22 |
-
'param2': param2
|
| 23 |
-
}
|
| 24 |
-
|
| 25 |
-
return jsonify(response), 200
|
| 26 |
-
|
| 27 |
-
if __name__ == '__main__':
|
| 28 |
-
app.run(debug=True, host='0.0.0.0', port=8000)
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
|
| 3 |
+
def process_audio_and_strings(audio_file, string1, string2):
|
| 4 |
+
# This function would process the audio file and strings as needed.
|
| 5 |
+
# For demonstration, it just returns a confirmation message.
|
| 6 |
+
return f"Received audio file: {audio_file.name}, and strings: '{string1}', '{string2}'"
|
| 7 |
|
| 8 |
+
# Define the Gradio interface
|
| 9 |
+
iface = gr.Interface(
|
| 10 |
+
fn=process_audio_and_strings,
|
| 11 |
+
inputs=[
|
| 12 |
+
gr.Audio(source="upload", type="file"),
|
| 13 |
+
gr.Textbox(label="String 1"),
|
| 14 |
+
gr.Textbox(label="String 2")
|
| 15 |
+
],
|
| 16 |
+
outputs="text"
|
| 17 |
+
)
|
| 18 |
|
| 19 |
+
# Launch the app
|
| 20 |
+
if __name__ == "__main__":
|
| 21 |
+
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|