Update handler.py
Browse files- 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="
|
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 |
|