Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
with gr.Blocks(title="Styling Examples") as demo:
|
4 |
+
with gr.Column(variant="box"):
|
5 |
+
txt = gr.Textbox(label="Small Textbox", lines=1)
|
6 |
+
num = gr.Number(label="Number", show_label=False)
|
7 |
+
slider = gr.Slider(label="Slider", show_label=False)
|
8 |
+
check = gr.Checkbox(label="Checkbox", show_label=False)
|
9 |
+
check_g = gr.CheckboxGroup(
|
10 |
+
label="Checkbox Group",
|
11 |
+
choices=["One", "Two", "Three"],
|
12 |
+
show_label=False,
|
13 |
+
)
|
14 |
+
radio = gr.Radio(
|
15 |
+
label="Radio", choices=["One", "Two", "Three"], show_label=False
|
16 |
+
).style(
|
17 |
+
item_container=False,
|
18 |
+
)
|
19 |
+
drop = gr.Dropdown(
|
20 |
+
label="Dropdown", choices=["One", "Two", "Three"], show_label=False
|
21 |
+
)
|
22 |
+
image = gr.Image(show_label=False)
|
23 |
+
video = gr.Video(show_label=False)
|
24 |
+
audio = gr.Audio(show_label=False)
|
25 |
+
file = gr.File(show_label=False)
|
26 |
+
df = gr.Dataframe(show_label=False)
|
27 |
+
ts = gr.Timeseries(show_label=False)
|
28 |
+
label = gr.Label().style(
|
29 |
+
container=False,
|
30 |
+
)
|
31 |
+
highlight = gr.HighlightedText(
|
32 |
+
"+ hello. - goodbye",
|
33 |
+
show_label=False,
|
34 |
+
).style(color_map={"+": "green", "-": "red"}, container=False)
|
35 |
+
json = gr.JSON().style(container=False)
|
36 |
+
html = gr.HTML(show_label=False)
|
37 |
+
gallery = gr.Gallery().style(
|
38 |
+
grid=(3, 3, 1),
|
39 |
+
height="auto",
|
40 |
+
container=False,
|
41 |
+
)
|
42 |
+
chat = gr.Chatbot([("hi", "good bye")]).style(color_map=("pink", "blue"))
|
43 |
+
|
44 |
+
model = gr.Model3D()
|
45 |
+
|
46 |
+
md = gr.Markdown(show_label=False)
|
47 |
+
|
48 |
+
highlight = gr.HighlightedText()
|
49 |
+
|
50 |
+
btn = gr.Button("Run").style(
|
51 |
+
full_width=True,
|
52 |
+
)
|
53 |
+
|
54 |
+
gr.Dataset(components=[txt, num])
|
55 |
+
|
56 |
+
if __name__ == "__main__":
|
57 |
+
demo.launch()
|