| """Test the custom handler.""" | |
| from handler import EndpointHandler | |
| import os | |
| import base64 | |
| handler = EndpointHandler(path="whisper-tiny") | |
| with open("frank.wav", "rb") as file: | |
| audio = file.read() | |
| audio = base64.b64encode(audio) | |
| payload = {"inputs": {"audio": audio, "language": "nl", "task": "transcribe"}} | |
| output = handler(payload) | |
| print(output["text"]) | |
| print("\n") | |
| print(output["chunks"]) |