Buckets:

download
raw
1.16 kB
import gradio as gr
from gradio.media import get_audio, MEDIA_PATHS
# get_audio returns the path to the audio file
audio_file = get_audio("cantina.wav")
with gr.Blocks() as demo:
with gr.Tab("Audio"):
gr.Audio(audio_file, buttons=["download"])
with gr.Tab("Interface"):
gr.Interface(
lambda x: x,
gr.Audio(),
gr.Audio(),
examples=[audio_file],
cache_examples=True,
api_name="predict",
)
with gr.Tab("Streaming"):
gr.Interface(
lambda x: x,
gr.Audio(streaming=True),
"audio",
examples=[audio_file],
cache_examples=True,
api_name="predict",
)
with gr.Tab("console"):
ip = gr.Textbox(label="User IP Address")
gr.Interface(
lambda cmd: f"You typed this command: {cmd}",
"text",
"text",
api_name="predict",
)
def get_ip(request: gr.Request):
return request.client.host
demo.load(get_ip, None, ip)
if __name__ == "__main__":
demo.launch(allowed_paths=MEDIA_PATHS)

Xet Storage Details

Size:
1.16 kB
·
Xet hash:
985d73fb31d3ff764340d980ff5465d3b6cc907464128faf6d2c1cf457117d31

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.