Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ app = FastAPI()
|
|
12 |
langs = ["None"] + sorted(list(whisper.tokenizer.LANGUAGES.values()))
|
13 |
model_size = list(whisper._MODELS.keys())
|
14 |
|
15 |
-
@app.get("/")
|
16 |
def read_main():
|
17 |
return {"message": "This is your main app"}
|
18 |
|
@@ -22,8 +22,8 @@ def read_main():
|
|
22 |
# Stream the subtitle as a response
|
23 |
#return StreamingResponse(requests.get(subtitle_url, stream=True).iter_content(chunk_size=1024))
|
24 |
|
25 |
-
|
26 |
-
|
27 |
# Download subtitles if available
|
28 |
ydl_opts = {
|
29 |
'writesubtitles': True,
|
|
|
12 |
langs = ["None"] + sorted(list(whisper.tokenizer.LANGUAGES.values()))
|
13 |
model_size = list(whisper._MODELS.keys())
|
14 |
|
15 |
+
@app.get("/test")
|
16 |
def read_main():
|
17 |
return {"message": "This is your main app"}
|
18 |
|
|
|
22 |
# Stream the subtitle as a response
|
23 |
#return StreamingResponse(requests.get(subtitle_url, stream=True).iter_content(chunk_size=1024))
|
24 |
|
25 |
+
|
26 |
+
def get_subtitle(url, lang='en'):
|
27 |
# Download subtitles if available
|
28 |
ydl_opts = {
|
29 |
'writesubtitles': True,
|