clap1 / call_handler.py
arthur-stackadoc-com's picture
added requests + test on requests
081fde1
raw
history blame contribute delete
825 Bytes
import base64
from handler import EndpointHandler
if __name__ == '__main__':
# init handler
my_handler = EndpointHandler(path=".")
# TEXT -----------------------------------------------------------------------------------------
text_payload = {"inputs": "I am quite excited how this will turn out"}
text_pred = my_handler(text_payload)
print("text_pred", text_pred)
#
# # AUDIO ----------------------------------------------------------------------------------------
# audio_payload = {"audio": base64.b64encode(
# open(
# "/home/arthur/data/musicdb/split_demucses/474499231_456751864 --__-- Breakbot - Programme_mp3_drums/chunk_11.wav",
# 'rb').read())}
# audio_pred = my_handler(audio_payload)
# print("audio_pred", audio_pred) # show results