Update good_handler.py
Browse files- good_handler.py +0 -6
good_handler.py
CHANGED
|
@@ -6,13 +6,8 @@ import torch
|
|
| 6 |
|
| 7 |
class EndpointHandler:
|
| 8 |
def __init__(self, path=""):
|
| 9 |
-
|
| 10 |
self.pipe = pipeline(task='automatic-speech-recognition', model=path)
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
# Move model to device
|
| 15 |
-
# self.model.to(device)
|
| 16 |
|
| 17 |
def __call__(self, data: Any) -> List[Dict[str, str]]:
|
| 18 |
print('==========NEW PROCESS=========')
|
|
@@ -20,5 +15,4 @@ class EndpointHandler:
|
|
| 20 |
transcribe.model.config.forced_decoder_ids = transcribe.tokenizer.get_decoder_prompt_ids(language="ko", task="transcribe")
|
| 21 |
result = transcribe(data['inputs'])
|
| 22 |
|
| 23 |
-
|
| 24 |
return result
|
|
|
|
| 6 |
|
| 7 |
class EndpointHandler:
|
| 8 |
def __init__(self, path=""):
|
|
|
|
| 9 |
self.pipe = pipeline(task='automatic-speech-recognition', model=path)
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
def __call__(self, data: Any) -> List[Dict[str, str]]:
|
| 13 |
print('==========NEW PROCESS=========')
|
|
|
|
| 15 |
transcribe.model.config.forced_decoder_ids = transcribe.tokenizer.get_decoder_prompt_ids(language="ko", task="transcribe")
|
| 16 |
result = transcribe(data['inputs'])
|
| 17 |
|
|
|
|
| 18 |
return result
|