Spaces:
Runtime error
Runtime error
Armandoliv
commited on
Commit
·
fb94c0b
1
Parent(s):
93d7c3b
Update app.py
Browse files
app.py
CHANGED
@@ -2,17 +2,16 @@ import gradio as gr
|
|
2 |
import torch
|
3 |
import spacy
|
4 |
import os
|
5 |
-
import whisper
|
6 |
os.system('pip install https://huggingface.co/Armandoliv/es_pipeline/resolve/main/es_pipeline-any-py3-none-any.whl')
|
7 |
os.system('pip install git+https://github.com/openai/whisper.git')
|
8 |
-
|
9 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
10 |
|
11 |
|
12 |
nlp_ner = spacy.load("es_pipeline")
|
13 |
|
14 |
def main_generator(youtube_id:str):
|
15 |
-
YouTubeID = youtube_id #
|
16 |
OutputFile = 'test_audio_youtube_.m4a'
|
17 |
|
18 |
os.system(f"youtube-dl -o {OutputFile} {YouTubeID} --extract-audio --restrict-filenames -f 'bestaudio[ext=m4a]'")
|
@@ -48,4 +47,4 @@ io = gr.Interface(fn=main_generator, inputs=inputs, outputs=outputs, title=title
|
|
48 |
color:white !important}"""
|
49 |
)
|
50 |
|
51 |
-
io.launch(
|
|
|
2 |
import torch
|
3 |
import spacy
|
4 |
import os
|
|
|
5 |
os.system('pip install https://huggingface.co/Armandoliv/es_pipeline/resolve/main/es_pipeline-any-py3-none-any.whl')
|
6 |
os.system('pip install git+https://github.com/openai/whisper.git')
|
7 |
+
import whisper
|
8 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
9 |
|
10 |
|
11 |
nlp_ner = spacy.load("es_pipeline")
|
12 |
|
13 |
def main_generator(youtube_id:str):
|
14 |
+
YouTubeID = youtube_id #
|
15 |
OutputFile = 'test_audio_youtube_.m4a'
|
16 |
|
17 |
os.system(f"youtube-dl -o {OutputFile} {YouTubeID} --extract-audio --restrict-filenames -f 'bestaudio[ext=m4a]'")
|
|
|
47 |
color:white !important}"""
|
48 |
)
|
49 |
|
50 |
+
io.launch()
|