vineelpratap commited on
Commit
6f53272
1 Parent(s): cdce2bf

Update asr.py

Browse files
Files changed (1) hide show
  1. asr.py +4 -4
asr.py CHANGED
@@ -51,8 +51,7 @@ model = Wav2Vec2ForCTC.from_pretrained(MODEL_ID)
51
  # filename=decoding_config["lexiconfile"].rsplit("/", 1)[1],
52
  # subfolder=decoding_config["lexiconfile"].rsplit("/", 1)[0],
53
  # )
54
-
55
- beam_search_decoder = None
56
  # beam_search_decoder = ctc_decoder(
57
  # lexicon=lexicon_file,
58
  # tokens=token_file,
@@ -112,8 +111,9 @@ def transcribe(
112
  ids = torch.argmax(outputs, dim=-1)[0]
113
  transcription = processor.decode(ids)
114
  else:
115
- beam_search_result = beam_search_decoder(outputs.to("cpu"))
116
- transcription = " ".join(beam_search_result[0][0].words).strip()
 
117
 
118
  return transcription
119
 
 
51
  # filename=decoding_config["lexiconfile"].rsplit("/", 1)[1],
52
  # subfolder=decoding_config["lexiconfile"].rsplit("/", 1)[0],
53
  # )
54
+
 
55
  # beam_search_decoder = ctc_decoder(
56
  # lexicon=lexicon_file,
57
  # tokens=token_file,
 
111
  ids = torch.argmax(outputs, dim=-1)[0]
112
  transcription = processor.decode(ids)
113
  else:
114
+ assert False
115
+ # beam_search_result = beam_search_decoder(outputs.to("cpu"))
116
+ # transcription = " ".join(beam_search_result[0][0].words).strip()
117
 
118
  return transcription
119