Spaces:
Sleeping
Sleeping
Initial commit with FastAPI + Gradio app
Browse files
app.py
CHANGED
@@ -83,8 +83,8 @@ def gradio_interface():
|
|
83 |
return gr.Interface(
|
84 |
fn=compare_voices,
|
85 |
inputs=[
|
86 |
-
gr.Audio(
|
87 |
-
gr.Audio(
|
88 |
],
|
89 |
outputs="json", # Output results as JSON
|
90 |
live=False # No live interface, just the API
|
@@ -94,11 +94,11 @@ def gradio_interface():
|
|
94 |
@app.on_event("startup")
|
95 |
async def startup():
|
96 |
gr.Interface(fn=compare_voices, inputs=[
|
97 |
-
gr.Audio(
|
98 |
-
gr.Audio(
|
99 |
], outputs="json", live=False).launch(share=True, inline=True)
|
100 |
|
101 |
-
#
|
102 |
if __name__ == "__main__":
|
103 |
import uvicorn
|
104 |
uvicorn.run(app, host="0.0.0.0", port=5000)
|
|
|
83 |
return gr.Interface(
|
84 |
fn=compare_voices,
|
85 |
inputs=[
|
86 |
+
gr.Audio(type="file", label="First Audio File"), # Updated to use `type="file"`
|
87 |
+
gr.Audio(type="file", label="Second Audio File") # Updated to use `type="file"`
|
88 |
],
|
89 |
outputs="json", # Output results as JSON
|
90 |
live=False # No live interface, just the API
|
|
|
94 |
@app.on_event("startup")
|
95 |
async def startup():
|
96 |
gr.Interface(fn=compare_voices, inputs=[
|
97 |
+
gr.Audio(type="file", label="First Audio File"), # Updated to use `type="file"`
|
98 |
+
gr.Audio(type="file", label="Second Audio File") # Updated to use `type="file"`
|
99 |
], outputs="json", live=False).launch(share=True, inline=True)
|
100 |
|
101 |
+
# Running the FastAPI app with Gradio
|
102 |
if __name__ == "__main__":
|
103 |
import uvicorn
|
104 |
uvicorn.run(app, host="0.0.0.0", port=5000)
|