Update app.py
Browse files
app.py
CHANGED
|
@@ -167,60 +167,6 @@ with gr.Blocks(title="ποΈ Catalan-Spanish ASR", theme=theme, css=custom_css)
|
|
| 167 |
gr.Markdown("# ποΈ Catalan-Spanish Audio Transcription")
|
| 168 |
gr.Markdown("*Powered by NeMo ASR β’ Supports Spanish & Catalan*")
|
| 169 |
|
| 170 |
-
# API Info - Gradio's built-in API
|
| 171 |
-
with gr.Accordion("π API Access", open=False):
|
| 172 |
-
gr.Markdown("### Gradio API Endpoint")
|
| 173 |
-
gr.Markdown(f"The API endpoint is automatically available at:")
|
| 174 |
-
gr.Textbox(
|
| 175 |
-
value=f"https://{SPACE_HOST}/api/predict",
|
| 176 |
-
label="Endpoint URL",
|
| 177 |
-
interactive=False,
|
| 178 |
-
show_copy_button=True
|
| 179 |
-
)
|
| 180 |
-
|
| 181 |
-
gr.Markdown("---")
|
| 182 |
-
gr.Markdown("### Python Example (using gradio_client)")
|
| 183 |
-
gr.Code(
|
| 184 |
-
value=f"""from gradio_client import Client
|
| 185 |
-
|
| 186 |
-
client = Client("https://{SPACE_HOST}")
|
| 187 |
-
result = client.predict(
|
| 188 |
-
audio_file="path/to/audio.wav",
|
| 189 |
-
api_name="/transcribe"
|
| 190 |
-
)
|
| 191 |
-
print(result)""",
|
| 192 |
-
language="python",
|
| 193 |
-
label="Python - Gradio Client"
|
| 194 |
-
)
|
| 195 |
-
|
| 196 |
-
gr.Markdown("---")
|
| 197 |
-
gr.Markdown("### Alternative (using requests)")
|
| 198 |
-
gr.Code(
|
| 199 |
-
value=f"""import requests
|
| 200 |
-
|
| 201 |
-
files = {{"data": open("audio.wav", "rb")}}
|
| 202 |
-
response = requests.post(
|
| 203 |
-
"https://{SPACE_HOST}/api/predict",
|
| 204 |
-
files=files
|
| 205 |
-
)
|
| 206 |
-
print(response.json())""",
|
| 207 |
-
language="python",
|
| 208 |
-
label="Python - Requests"
|
| 209 |
-
)
|
| 210 |
-
|
| 211 |
-
gr.Markdown("---")
|
| 212 |
-
gr.Markdown("### cURL Example")
|
| 213 |
-
gr.Textbox(
|
| 214 |
-
value=f"""curl -X POST "https://{SPACE_HOST}/api/predict" \\
|
| 215 |
-
-F "[email protected]" """,
|
| 216 |
-
label="cURL",
|
| 217 |
-
interactive=False,
|
| 218 |
-
lines=2,
|
| 219 |
-
show_copy_button=True
|
| 220 |
-
)
|
| 221 |
-
|
| 222 |
-
gr.Markdown("*Note: Gradio automatically provides an API for all interfaces. No custom endpoints needed!*")
|
| 223 |
-
|
| 224 |
with gr.Tabs():
|
| 225 |
# Transcription Tab
|
| 226 |
with gr.Tab("π€ Transcribe"):
|
|
|
|
| 167 |
gr.Markdown("# ποΈ Catalan-Spanish Audio Transcription")
|
| 168 |
gr.Markdown("*Powered by NeMo ASR β’ Supports Spanish & Catalan*")
|
| 169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
with gr.Tabs():
|
| 171 |
# Transcription Tab
|
| 172 |
with gr.Tab("π€ Transcribe"):
|