Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ from process_audio import segment_audio
|
|
6 |
from write_srt import write_to_file
|
7 |
from clean_text import clean_english, clean_german, clean_spanish
|
8 |
from transformers import Wav2Vec2Processor, Wav2Vec2ForCTC
|
|
|
9 |
import torch
|
10 |
import gradio as gr
|
11 |
|
@@ -14,13 +15,13 @@ english_model = "facebook/wav2vec2-large-960h-lv60-self"
|
|
14 |
english_tokenizer = Wav2Vec2Processor.from_pretrained(english_model)
|
15 |
english_asr_model = Wav2Vec2ForCTC.from_pretrained(english_model)
|
16 |
|
17 |
-
german_model = "
|
18 |
-
german_tokenizer =
|
19 |
-
german_asr_model =
|
20 |
|
21 |
spanish_model = "patrickvonplaten/wav2vec2-large-xlsr-53-spanish-with-lm"
|
22 |
-
spanish_tokenizer =
|
23 |
-
spanish_asr_model =
|
24 |
|
25 |
# Get German corpus and update nltk
|
26 |
command = ["python", "-m", "textblob.download_corpora"]
|
|
|
6 |
from write_srt import write_to_file
|
7 |
from clean_text import clean_english, clean_german, clean_spanish
|
8 |
from transformers import Wav2Vec2Processor, Wav2Vec2ForCTC
|
9 |
+
from transformers import AutoModelForCTC, AutoProcessor
|
10 |
import torch
|
11 |
import gradio as gr
|
12 |
|
|
|
15 |
english_tokenizer = Wav2Vec2Processor.from_pretrained(english_model)
|
16 |
english_asr_model = Wav2Vec2ForCTC.from_pretrained(english_model)
|
17 |
|
18 |
+
german_model = "flozi00/wav2vec2-large-xlsr-53-german-with-lm"
|
19 |
+
german_tokenizer = AutoProcessor.from_pretrained(german_model)
|
20 |
+
german_asr_model = AutoModelForCTC.from_pretrained(german_model)
|
21 |
|
22 |
spanish_model = "patrickvonplaten/wav2vec2-large-xlsr-53-spanish-with-lm"
|
23 |
+
spanish_tokenizer = AutoProcessor.from_pretrained(spanish_model)
|
24 |
+
spanish_asr_model = AutoModelForCTC.from_pretrained(spanish_model)
|
25 |
|
26 |
# Get German corpus and update nltk
|
27 |
command = ["python", "-m", "textblob.download_corpora"]
|