Update handler.py
Browse files- handler.py +4 -2
handler.py
CHANGED
@@ -23,11 +23,13 @@ class EndpointHandler():
|
|
23 |
"""
|
24 |
# process input
|
25 |
inputs = data.pop("inputs", data)
|
|
|
26 |
audio_nparray = ffmpeg_read(inputs, SAMPLE_RATE)
|
27 |
audio_tensor= torch.from_numpy(audio_nparray)
|
28 |
|
29 |
# run inference pipeline
|
30 |
-
result = self.model.transcribe(audio_nparray
|
|
|
31 |
|
32 |
# postprocess the prediction
|
33 |
-
return
|
|
|
23 |
"""
|
24 |
# process input
|
25 |
inputs = data.pop("inputs", data)
|
26 |
+
|
27 |
audio_nparray = ffmpeg_read(inputs, SAMPLE_RATE)
|
28 |
audio_tensor= torch.from_numpy(audio_nparray)
|
29 |
|
30 |
# run inference pipeline
|
31 |
+
result = self.model.transcribe(audio_nparray, language = 'russian',
|
32 |
+
verbose = True, response_format = 'srt', return_timestamps=True,word_timestamps = True)
|
33 |
|
34 |
# postprocess the prediction
|
35 |
+
return [0,result,2]
|