aliabd HF Staff commited on
Commit
e3131be
·
1 Parent(s): 81bfee4

Upload with huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +5 -6
  2. requirements.txt +1 -0
  3. run.py +95 -0
README.md CHANGED
@@ -1,12 +1,11 @@
 
1
  ---
2
- title: Blocks Outputs Main
3
- emoji: 📉
4
- colorFrom: yellow
5
  colorTo: indigo
6
  sdk: gradio
7
  sdk_version: 3.6
8
- app_file: app.py
9
  pinned: false
10
  ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
+
2
  ---
3
+ title: blocks_outputs_main
4
+ emoji: 🔥
5
+ colorFrom: indigo
6
  colorTo: indigo
7
  sdk: gradio
8
  sdk_version: 3.6
9
+ app_file: run.py
10
  pinned: false
11
  ---
 
 
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ https://gradio-main-build.s3.amazonaws.com/c3bec6153737855510542e8154391f328ac72606/gradio-3.6-py3-none-any.whl
run.py ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+
4
+ def make_markdown():
5
+ return [
6
+ [
7
+ "# hello again",
8
+ "Hello my name is frank, I am liking the small turtle you have there. It would be a shame if it went missing.",
9
+ '<img src="https://images.unsplash.com/photo-1574613362884-f79513a5128c?fit=crop&w=500&q=80"/>',
10
+ ],
11
+ [
12
+ "## hello again again",
13
+ "Hello my name is frank, I am liking the small turtle you have there. It would be a shame if it went missing.",
14
+ '<img src="https://images.unsplash.com/photo-1574613362884-f79513a5128c?fit=crop&w=500&q=80"/>',
15
+ ],
16
+ [
17
+ "### hello thrice",
18
+ "Hello my name is frank, I am liking the small turtle you have there. It would be a shame if it went missing.",
19
+ '<img src="https://images.unsplash.com/photo-1574613362884-f79513a5128c?fit=crop&w=500&q=80"/>',
20
+ ],
21
+ ]
22
+
23
+
24
+ with gr.Blocks() as demo:
25
+ with gr.Column():
26
+ txt = gr.Textbox(label="Small Textbox", lines=1, show_label=False)
27
+ txt = gr.Textbox(label="Large Textbox", lines=5, show_label=False)
28
+ num = gr.Number(label="Number", show_label=False)
29
+ check = gr.Checkbox(label="Checkbox", show_label=False)
30
+ check_g = gr.CheckboxGroup(
31
+ label="Checkbox Group", choices=["One", "Two", "Three"], show_label=False
32
+ )
33
+ radio = gr.Radio(
34
+ label="Radio", choices=["One", "Two", "Three"], show_label=False
35
+ )
36
+ drop = gr.Dropdown(
37
+ label="Dropdown", choices=["One", "Two", "Three"], show_label=False
38
+ )
39
+ slider = gr.Slider(label="Slider", show_label=False)
40
+ audio = gr.Audio(show_label=False)
41
+ file = gr.File(show_label=False)
42
+ video = gr.Video(show_label=False)
43
+ image = gr.Image(show_label=False)
44
+ ts = gr.Timeseries(show_label=False)
45
+ df = gr.Dataframe(show_label=False)
46
+ html = gr.HTML(show_label=False)
47
+ json = gr.JSON(show_label=False)
48
+ md = gr.Markdown(show_label=False)
49
+ label = gr.Label(show_label=False)
50
+ highlight = gr.HighlightedText(show_label=False)
51
+ gr.Dataframe(interactive=True, col_count=(3, "fixed"), label="Dataframe")
52
+ gr.Dataframe(interactive=True, col_count=4, label="Dataframe")
53
+ gr.Dataframe(
54
+ interactive=True, headers=["One", "Two", "Three", "Four"], label="Dataframe"
55
+ )
56
+ gr.Dataframe(
57
+ interactive=True,
58
+ headers=["One", "Two", "Three", "Four"],
59
+ col_count=(4, "fixed"),
60
+ row_count=(7, "fixed"),
61
+ value=[[0, 0, 0, 0]],
62
+ label="Dataframe",
63
+ )
64
+ gr.Dataframe(
65
+ interactive=True, headers=["One", "Two", "Three", "Four"], col_count=4
66
+ )
67
+ df = gr.DataFrame(
68
+ [
69
+ [
70
+ "# hello",
71
+ "Hello my name is frank, I am liking the small turtle you have there. It would be a shame if it went missing.",
72
+ '<img src="https://images.unsplash.com/photo-1574613362884-f79513a5128c?fit=crop&w=500&q=80"/>',
73
+ ],
74
+ [
75
+ "## hello",
76
+ "Hello my name is frank, I am liking the small turtle you have there. It would be a shame if it went missing.",
77
+ '<img src="https://images.unsplash.com/photo-1574613362884-f79513a5128c?fit=crop&w=500&q=80"/>',
78
+ ],
79
+ [
80
+ "### hello",
81
+ "Hello my name is frank, I am liking the small turtle you have there. It would be a shame if it went missing.",
82
+ '<img src="https://images.unsplash.com/photo-1574613362884-f79513a5128c?fit=crop&w=500&q=80"/>',
83
+ ],
84
+ ],
85
+ headers=["One", "Two", "Three"],
86
+ wrap=True,
87
+ datatype=["markdown", "markdown", "html"],
88
+ interactive=True,
89
+ )
90
+ btn = gr.Button("Run")
91
+ btn.click(fn=make_markdown, inputs=None, outputs=df)
92
+
93
+
94
+ if __name__ == "__main__":
95
+ demo.launch()