Update handler.py
Browse files- handler.py +2 -2
handler.py
CHANGED
@@ -12,13 +12,13 @@ import io
|
|
12 |
|
13 |
class EndpointHandler:
|
14 |
def __init__(self, path=""):
|
15 |
-
self.tokenizer = WhisperTokenizer.from_pretrained(
|
16 |
self.model = WhisperForConditionalGeneration.from_pretrained(path)
|
17 |
#self.tokenizer = WhisperTokenizer.from_pretrained(path)
|
18 |
self.processor = WhisperProcessor.from_pretrained(path, language="korean", task='transcribe')
|
19 |
#self.processor = AutoProcessor.from_pretrained(path)
|
20 |
#self.pipe = pipeline("automatic-speech-recognition", model=model, tokenizer=processor.feature_extractor, feature_extractor=processor.feature_extractor)
|
21 |
-
self.feature_extractor = WhisperFeatureExtractor.from_pretrained(
|
22 |
|
23 |
|
24 |
# Move model to device
|
|
|
12 |
|
13 |
class EndpointHandler:
|
14 |
def __init__(self, path=""):
|
15 |
+
self.tokenizer = WhisperTokenizer.from_pretrained('openai/whisper-large', language="korean", task='transcribe')
|
16 |
self.model = WhisperForConditionalGeneration.from_pretrained(path)
|
17 |
#self.tokenizer = WhisperTokenizer.from_pretrained(path)
|
18 |
self.processor = WhisperProcessor.from_pretrained(path, language="korean", task='transcribe')
|
19 |
#self.processor = AutoProcessor.from_pretrained(path)
|
20 |
#self.pipe = pipeline("automatic-speech-recognition", model=model, tokenizer=processor.feature_extractor, feature_extractor=processor.feature_extractor)
|
21 |
+
self.feature_extractor = WhisperFeatureExtractor.from_pretrained(path)
|
22 |
|
23 |
|
24 |
# Move model to device
|