Dibiddo commited on
Commit
eba8259
ยท
verified ยท
1 Parent(s): e37b77a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -6
app.py CHANGED
@@ -29,12 +29,18 @@ whisper_model = AutoModelForSpeechSeq2Seq.from_pretrained(
29
  whisper_model.to(device)
30
  whisper_processor = AutoProcessor.from_pretrained(whisper_model_id)
31
 
32
- whisper_pipe = pipeline(
33
- "automatic-speech-recognition",
34
- model=whisper_model,
35
- tokenizer=whisper_processor.tokenizer,
36
- feature_extractor=whisper_processor.feature_extractor,
37
- device=device)
 
 
 
 
 
 
38
 
39
  # spaCy ๅˆๅง‹ๅŒ–๏ผˆๆ–‡ๆœฌๅˆ†้กž่ˆ‡ๆจ™็ฑค๏ผ‰
40
  nlp=None
 
29
  whisper_model.to(device)
30
  whisper_processor = AutoProcessor.from_pretrained(whisper_model_id)
31
 
32
+ try:
33
+
34
+ whisper_pipe = pipeline(
35
+ "automatic-speech-recognition",
36
+ model=whisper_model,
37
+ tokenizer=whisper_processor.tokenizer,
38
+ feature_extractor=whisper_processor.feature_extractor,
39
+ device=device)
40
+
41
+ except Exception as e:
42
+
43
+ print(f"ๅˆๅง‹ๅŒ–Whisper็ฎก้“ๆ™‚ๅ‡บ็พ้Œฏ่ชค๏ผš{e}")
44
 
45
  # spaCy ๅˆๅง‹ๅŒ–๏ผˆๆ–‡ๆœฌๅˆ†้กž่ˆ‡ๆจ™็ฑค๏ผ‰
46
  nlp=None