- add custom endpoint handler
Browse files- handler.py +4 -2
handler.py
CHANGED
@@ -32,10 +32,12 @@ class EndpointHandler():
|
|
32 |
"""
|
33 |
#print request
|
34 |
print("request")
|
35 |
-
print(data)
|
36 |
# audio_data = read(io.BytesIO(data))
|
37 |
# get inputs, inputs in request body is possible equal to wav or mp3 file
|
38 |
inputs = data.pop("inputs", data)
|
39 |
-
|
|
|
40 |
text = self.pipe(inputs)["text"]
|
|
|
41 |
return text
|
|
|
32 |
"""
|
33 |
#print request
|
34 |
print("request")
|
35 |
+
print(data.inputs)
|
36 |
# audio_data = read(io.BytesIO(data))
|
37 |
# get inputs, inputs in request body is possible equal to wav or mp3 file
|
38 |
inputs = data.pop("inputs", data)
|
39 |
+
print("here comes text")
|
40 |
+
print(self.pipe(inputs))
|
41 |
text = self.pipe(inputs)["text"]
|
42 |
+
print(text)
|
43 |
return text
|