Spaces:
Runtime error
Runtime error
# import gradio library | |
import gradio as gr | |
import numpy as np | |
import base64 | |
import time | |
import gradio_client as grc | |
# client = grc.InterfaceDescriptionClient("https://gradio.app") | |
# define a function that takes input and returns output | |
client = grc.Client("facebook/seamless_m4t") | |
print(client.view_api(all_endpoints=True)) | |
job = client.submit( | |
"S2TT", | |
"file", | |
None, | |
"sample_input.mp3", | |
"", | |
"French", | |
"English", | |
api_name="/run", | |
) | |
while job.done() == False : | |
time.sleep(1) | |
gr.Markdown(job.result()) | |
# return out | |
# # print(client.view_api(all_endpoints=True)) | |
# def convert_image_to_required_format(audio): | |
# sr, data = audio | |
# return str(type(sr))+str(type(data)) | |
# # create a gradio interface | |
# iface = gr.Interface( | |
# fn=sound_to_text, | |
# inputs=[gr.Audio()], | |
# outputs=[gr.Markdown(label="Output Text")], | |
# ) | |
# iface.launch() | |