Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ os.system("pip install https://github.com/kpu/kenlm/archive/master.zip")
|
|
5 |
os.system("pip install pyctcdecode")
|
6 |
os.system("pip install gradio")
|
7 |
os.system("pip install librosa")
|
|
|
8 |
|
9 |
import gradio as gr
|
10 |
import librosa
|
@@ -19,6 +20,7 @@ from transformers import Wav2Vec2ProcessorWithLM
|
|
19 |
repo_name = "aiface/vietnamese_s2t"
|
20 |
|
21 |
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
|
|
|
22 |
processor = Wav2Vec2ProcessorWithLM.from_pretrained(repo_name, token="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")
|
23 |
model = Wav2Vec2ForCTC.from_pretrained(repo_name, token="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").to(device)
|
24 |
feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(repo_name, token="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")
|
|
|
5 |
os.system("pip install pyctcdecode")
|
6 |
os.system("pip install gradio")
|
7 |
os.system("pip install librosa")
|
8 |
+
os.system("pip install torch")
|
9 |
|
10 |
import gradio as gr
|
11 |
import librosa
|
|
|
20 |
repo_name = "aiface/vietnamese_s2t"
|
21 |
|
22 |
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
|
23 |
+
# device="cpu"
|
24 |
processor = Wav2Vec2ProcessorWithLM.from_pretrained(repo_name, token="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")
|
25 |
model = Wav2Vec2ForCTC.from_pretrained(repo_name, token="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").to(device)
|
26 |
feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(repo_name, token="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")
|