Update handler.py
Browse files- handler.py +3 -0
handler.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
from typing import Dict, List, Any
|
| 2 |
from transformers import pipeline
|
| 3 |
|
|
|
|
| 4 |
import torch
|
| 5 |
from transformers import (
|
| 6 |
AutomaticSpeechRecognitionPipeline,
|
|
@@ -43,4 +44,6 @@ class EndpointHandler():
|
|
| 43 |
inputs = data.pop("inputs", data)
|
| 44 |
prediction = self.pipeline(inputs, generate_kwargs={"forced_decoder_ids": self.forced_decoder_ids}, max_new_tokens=255)["text"]
|
| 45 |
print(prediction)
|
|
|
|
|
|
|
| 46 |
return prediction
|
|
|
|
| 1 |
from typing import Dict, List, Any
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
import sys
|
| 5 |
import torch
|
| 6 |
from transformers import (
|
| 7 |
AutomaticSpeechRecognitionPipeline,
|
|
|
|
| 44 |
inputs = data.pop("inputs", data)
|
| 45 |
prediction = self.pipeline(inputs, generate_kwargs={"forced_decoder_ids": self.forced_decoder_ids}, max_new_tokens=255)["text"]
|
| 46 |
print(prediction)
|
| 47 |
+
print(predcition, file=sys.stderr)
|
| 48 |
+
print(predcition, file=sys.stdout)
|
| 49 |
return prediction
|