- add custom endpoint handler
Browse files- requirements.txt +0 -6
- test-handler.py +14 -0
requirements.txt
CHANGED
@@ -1,11 +1,5 @@
|
|
1 |
-
soundfile
|
2 |
transformers
|
3 |
torch
|
4 |
-
sentencepiece
|
5 |
-
librosa
|
6 |
torchaudio
|
7 |
-
pyctcdecode
|
8 |
-
onnx
|
9 |
-
onnxruntime
|
10 |
pandas
|
11 |
datasets
|
|
|
|
|
1 |
transformers
|
2 |
torch
|
|
|
|
|
3 |
torchaudio
|
|
|
|
|
|
|
4 |
pandas
|
5 |
datasets
|
test-handler.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from handler import EndpointHandler
|
2 |
+
from pathlib import Path
|
3 |
+
|
4 |
+
|
5 |
+
p = Path(__file__).with_name('pytorch_model.bin')
|
6 |
+
filename = p.absolute()
|
7 |
+
my_handler = EndpointHandler(path=filename)
|
8 |
+
|
9 |
+
payload = {"inputs": "contact.wav"}
|
10 |
+
|
11 |
+
transcription=my_handler(payload)
|
12 |
+
|
13 |
+
print("here is the transcription")
|
14 |
+
print(transcription)
|