File size: 939 Bytes
de811b0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# 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()