Spaces:
Running
Running
Fix
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ model_name = "Yehor/wav2vec2-xls-r-1b-uk-with-lm"
|
|
8 |
tokenizer = Wav2Vec2CTCTokenizer.from_pretrained(model_name)
|
9 |
processor = Wav2Vec2ProcessorWithLM.from_pretrained(model_name)
|
10 |
model = Wav2Vec2ForCTC.from_pretrained(model_name)
|
11 |
-
model.to("
|
12 |
|
13 |
|
14 |
# define function to read in sound file
|
@@ -45,7 +45,6 @@ def inference(audio):
|
|
45 |
stride_length_s=(4, 2),
|
46 |
return_tensors="pt",
|
47 |
).input_values
|
48 |
-
input_values = input_values.cuda()
|
49 |
|
50 |
with torch.no_grad():
|
51 |
logits = model(input_values).logits
|
|
|
8 |
tokenizer = Wav2Vec2CTCTokenizer.from_pretrained(model_name)
|
9 |
processor = Wav2Vec2ProcessorWithLM.from_pretrained(model_name)
|
10 |
model = Wav2Vec2ForCTC.from_pretrained(model_name)
|
11 |
+
model.to("cpu")
|
12 |
|
13 |
|
14 |
# define function to read in sound file
|
|
|
45 |
stride_length_s=(4, 2),
|
46 |
return_tensors="pt",
|
47 |
).input_values
|
|
|
48 |
|
49 |
with torch.no_grad():
|
50 |
logits = model(input_values).logits
|