Evan-Lin commited on
Commit
8d88f31
1 Parent(s): c3cd4b7

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +2 -2
handler.py CHANGED
@@ -2,8 +2,8 @@ from typing import Dict, List, Any
2
  from transformers import pipeline
3
 
4
  class EndpointHandler():
5
- def __init__(self, path="Evan-Lin/whisper-large-v1-tw"):
6
- self.pipeline = pipeline(model=path)
7
  self.pipeline.model.config.forced_decoder_ids = self.pipeline.model.processor.get_decoder_prompt_ids(language="Chinese", task="transcribe")
8
  self.pipeline.model.generation_config.forced_decoder_ids = self.pipeline.model.config.forced_decoder_ids # just to be sure!
9
 
 
2
  from transformers import pipeline
3
 
4
  class EndpointHandler():
5
+ def __init__(self, path=""):
6
+ self.pipeline = pipeline("automatic-speech-recognition", model=path)
7
  self.pipeline.model.config.forced_decoder_ids = self.pipeline.model.processor.get_decoder_prompt_ids(language="Chinese", task="transcribe")
8
  self.pipeline.model.generation_config.forced_decoder_ids = self.pipeline.model.config.forced_decoder_ids # just to be sure!
9