File size: 966 Bytes
8d5f9e5 c03236e 5ffe53c 069384f c49dd59 |
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 |
import gradio as gr
def video_flip(video):
return video
demo = gr.Interface(video_flip, gr.Video(), "playable_video", value="zC3EhH5ssposNojKpYfp--85T53.mp4" interactive=True)
#import gradio as gr
def sentence_builder(quantity, animal, place, activity_list, morning):
return f"""The {quantity} {animal}s went to the {place} where they {" and ".join(activity_list)} until the {"morning" if morning else "night"}"""
demo2 = gr.Interface(
sentence_builder,
[
gr.Slider(2, 20),
gr.Dropdown(["cat", "dog", "bird"]),
gr.Radio(["park", "zoo", "road"]),
gr.CheckboxGroup(["ran", "swam", "ate", "slept"]),
gr.Checkbox(label="Is it the morning?"),
],
"text",
examples=[
[2, "cat", "park", ["ran", "swam"], True],
[4, "dog", "zoo", ["ate", "swam"], False],
[10, "bird", "road", ["ran"], False],
[8, "cat", "zoo", ["ate"], True],
],
)
demo.launch()
#demo2.launch() |