Spaces:
Runtime error
Runtime error
Commit
·
a7fe776
1
Parent(s):
7ab63b0
remove api info
Browse files
app.py
CHANGED
|
@@ -13,46 +13,6 @@ You can submit requests to Whisper JAX through this Gradio Demo, or directly thr
|
|
| 13 |
|
| 14 |
API_URL = "https://whisper-jax.ngrok.io/generate/"
|
| 15 |
|
| 16 |
-
api_info = """## Python API call:
|
| 17 |
-
```python
|
| 18 |
-
import requests
|
| 19 |
-
|
| 20 |
-
response = requests.post("{URL}", json={
|
| 21 |
-
"inputs": "/path/to/file/audio.mp3",
|
| 22 |
-
"task": "transcribe",
|
| 23 |
-
"return_timestamps": False,
|
| 24 |
-
}).json()
|
| 25 |
-
|
| 26 |
-
data = response["data"]
|
| 27 |
-
```
|
| 28 |
-
|
| 29 |
-
## Javascript API call:
|
| 30 |
-
```javascript
|
| 31 |
-
fetch("{URL}", {
|
| 32 |
-
method: "POST",
|
| 33 |
-
headers: { "Content-Type": "application/json" },
|
| 34 |
-
body: JSON.stringify({
|
| 35 |
-
data: [
|
| 36 |
-
"/path/to/file/audio.mp3",
|
| 37 |
-
"afrikaans",
|
| 38 |
-
"transcribe",
|
| 39 |
-
false,
|
| 40 |
-
]
|
| 41 |
-
})})
|
| 42 |
-
.then(r => r.json())
|
| 43 |
-
.then(
|
| 44 |
-
r => {
|
| 45 |
-
let data = r.data;
|
| 46 |
-
}
|
| 47 |
-
)
|
| 48 |
-
```
|
| 49 |
-
|
| 50 |
-
## CURL API call:
|
| 51 |
-
```
|
| 52 |
-
curl -X POST -d '{"inputs": "/path/to/file/audio.mp3", "task": "transcribe", "return_timestamps": false}' {URL} -H "content-type: application/json"
|
| 53 |
-
```
|
| 54 |
-
"""
|
| 55 |
-
api_info = api_info.replace("{URL}", API_URL)
|
| 56 |
article = "Whisper large-v2 model by OpenAI. Backend running JAX on a TPU v4-8 through the generous support of the [TRC](https://sites.research.google/trc/about/) programme."
|
| 57 |
|
| 58 |
language_names = sorted(TO_LANGUAGE_CODE.keys())
|
|
|
|
| 13 |
|
| 14 |
API_URL = "https://whisper-jax.ngrok.io/generate/"
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
article = "Whisper large-v2 model by OpenAI. Backend running JAX on a TPU v4-8 through the generous support of the [TRC](https://sites.research.google/trc/about/) programme."
|
| 17 |
|
| 18 |
language_names = sorted(TO_LANGUAGE_CODE.keys())
|