pgilles commited on
Commit
4294b59
·
1 Parent(s): 2079834

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -14,14 +14,15 @@ token_key = os.environ.get("HUGGING_FACE_HUB_TOKEN")
14
  #model_name = "unilux/wav2vec-xls-r-Luxembourgish20-with-LM"
15
  #model_name = "unilux/wav2vec-xlsr-300m-Luxembourgish-with-LM"
16
  model_name = "pgilles/whisper-large-lb"
17
- tokenizer = Wav2Vec2CTCTokenizer.from_pretrained(model_name, use_auth_token=token_key)
18
- model = Wav2Vec2ForCTC.from_pretrained(model_name, use_auth_token=token_key)
19
- processor = Wav2Vec2ProcessorWithLM.from_pretrained(model_name, use_auth_token=token_key)
20
 
21
  device = "cuda" if torch.cuda.is_available() else "cpu"
22
  model = model.to(device)
23
 
24
- p = pipeline("automatic-speech-recognition", model=model, tokenizer=tokenizer, feature_extractor=processor.feature_extractor, decoder=processor.decoder, use_auth_token=token_key)
 
25
 
26
  #p = pipeline("automatic-speech-recognition", model=model_name, use_auth_token = token_key)
27
  #p = pipeline("automatic-speech-recognition", model=model_name, use_auth_token = True)
 
14
  #model_name = "unilux/wav2vec-xls-r-Luxembourgish20-with-LM"
15
  #model_name = "unilux/wav2vec-xlsr-300m-Luxembourgish-with-LM"
16
  model_name = "pgilles/whisper-large-lb"
17
+ #tokenizer = Wav2Vec2CTCTokenizer.from_pretrained(model_name, use_auth_token=token_key)
18
+ #model = Wav2Vec2ForCTC.from_pretrained(model_name, use_auth_token=token_key)
19
+ #processor = Wav2Vec2ProcessorWithLM.from_pretrained(model_name, use_auth_token=token_key)
20
 
21
  device = "cuda" if torch.cuda.is_available() else "cpu"
22
  model = model.to(device)
23
 
24
+ #p = pipeline("automatic-speech-recognition", model=model, tokenizer=tokenizer, feature_extractor=processor.feature_extractor, decoder=processor.decoder, use_auth_token=token_key)
25
+ p = pipeline("automatic-speech-recognition", model=model, use_auth_token=token_key)
26
 
27
  #p = pipeline("automatic-speech-recognition", model=model_name, use_auth_token = token_key)
28
  #p = pipeline("automatic-speech-recognition", model=model_name, use_auth_token = True)