Yehor Smoliakov commited on
Commit
a208abb
1 Parent(s): 8cd0fcd

Back to CPU

Browse files
Files changed (2) hide show
  1. app.py +1 -2
  2. requirements.txt +2 -5
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("cuda")
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
requirements.txt CHANGED
@@ -5,8 +5,5 @@ jinja2==3.0.3
5
  git+https://github.com/huggingface/transformers@bb7949b35a0a2247bc20c7cb6d86764770ca3232
6
  pyctcdecode==0.3.0
7
  https://github.com/kpu/kenlm/archive/master.zip
8
- # torch
9
- -f https://download.pytorch.org/whl/cu113/torch_stable.html
10
- torch==1.10.2+cu113
11
- -f https://download.pytorch.org/whl/cu113/torch_stable.html
12
- torchaudio===0.10.2+cu113
 
5
  git+https://github.com/huggingface/transformers@bb7949b35a0a2247bc20c7cb6d86764770ca3232
6
  pyctcdecode==0.3.0
7
  https://github.com/kpu/kenlm/archive/master.zip
8
+ torch==1.10.2
9
+ torchaudio===0.10.2