Spaces:
Runtime error
Runtime error
model and pipeline update
Browse files
app.py
CHANGED
@@ -15,9 +15,11 @@ print("key length:", len(token_key.strip()))
|
|
15 |
model_name = "pgilles/whisper-large-v2-lb_cased_04"
|
16 |
#model_name = "pgilles/whisper-large-10_Chamber" # model too bad
|
17 |
|
|
|
18 |
#p = pipeline("automatic-speech-recognition", model=model, tokenizer=tokenizer, feature_extractor=processor.feature_extractor, decoder=processor.decoder, use_auth_token=token_key)
|
19 |
|
20 |
-
pipe = pipeline("automatic-speech-recognition", model=
|
|
|
21 |
#pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language= "Luxembourgish", task="transcribe")
|
22 |
#pipe.model.config.forced_decoder_ids = None
|
23 |
|
|
|
15 |
model_name = "pgilles/whisper-large-v2-lb_cased_04"
|
16 |
#model_name = "pgilles/whisper-large-10_Chamber" # model too bad
|
17 |
|
18 |
+
model = WhisperForConditionalGeneration.from_pretrained(best_asr_model, use_auth_token=token_key)
|
19 |
#p = pipeline("automatic-speech-recognition", model=model, tokenizer=tokenizer, feature_extractor=processor.feature_extractor, decoder=processor.decoder, use_auth_token=token_key)
|
20 |
|
21 |
+
pipe = pipeline("automatic-speech-recognition", model=model, device=0)
|
22 |
+
#pipe = pipeline("automatic-speech-recognition", model=model_name, device=0, use_auth_token=token_key)
|
23 |
#pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language= "Luxembourgish", task="transcribe")
|
24 |
#pipe.model.config.forced_decoder_ids = None
|
25 |
|