Spaces:
Runtime error
Runtime error
Commit
·
11d953b
1
Parent(s):
a6aebb9
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,12 @@ model_whisper = whisper.load_model("small")
|
|
10 |
nlp_ner = spacy.load("es_pipeline")
|
11 |
|
12 |
def main_generator(youtube_id:str):
|
13 |
-
YouTubeID = youtube_id #
|
|
|
|
|
|
|
|
|
|
|
14 |
OutputFile = 'test_audio_youtube_.m4a'
|
15 |
|
16 |
os.system(f"youtube-dl -o {OutputFile} {YouTubeID} --extract-audio --restrict-filenames -f 'bestaudio[ext=m4a]'")
|
@@ -32,9 +37,9 @@ def main_generator(youtube_id:str):
|
|
32 |
return {"text": text, "entities": output_list}
|
33 |
inputs = [gr.Textbox(lines=1, placeholder="Link of youtube video here...", label="Input")]
|
34 |
outputs = gr.HighlightedText()
|
35 |
-
title="ASR FOR MEDICAL RECORDS"
|
36 |
description = "This demo uses AI Models to create an AUDIO ANNOTATION FOR MEDICAL RECORDS"
|
37 |
-
examples = ['xOZM-1p-jAk']
|
38 |
|
39 |
io = gr.Interface(fn=main_generator, inputs=inputs, outputs=outputs, title=title, description = description, examples = examples,
|
40 |
|
|
|
10 |
nlp_ner = spacy.load("es_pipeline")
|
11 |
|
12 |
def main_generator(youtube_id:str):
|
13 |
+
YouTubeID = youtube_id.split("https://www.youtube.com/watch?v=") #
|
14 |
+
if len(YouTubeID)>1:
|
15 |
+
YouTubeID = YouTubeID[1]
|
16 |
+
else:
|
17 |
+
YouTubeID ='xOZM-1p-jAk'
|
18 |
+
|
19 |
OutputFile = 'test_audio_youtube_.m4a'
|
20 |
|
21 |
os.system(f"youtube-dl -o {OutputFile} {YouTubeID} --extract-audio --restrict-filenames -f 'bestaudio[ext=m4a]'")
|
|
|
37 |
return {"text": text, "entities": output_list}
|
38 |
inputs = [gr.Textbox(lines=1, placeholder="Link of youtube video here...", label="Input")]
|
39 |
outputs = gr.HighlightedText()
|
40 |
+
title="ASR FOR SPANISH MEDICAL RECORDS"
|
41 |
description = "This demo uses AI Models to create an AUDIO ANNOTATION FOR MEDICAL RECORDS"
|
42 |
+
examples = ['https://www.youtube.com/watch?v=xOZM-1p-jAk']
|
43 |
|
44 |
io = gr.Interface(fn=main_generator, inputs=inputs, outputs=outputs, title=title, description = description, examples = examples,
|
45 |
|