File size: 400 Bytes
a569fc7 7e06129 a569fc7 7e06129 a569fc7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
"""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"]) |