aliabd HF staff commited on
Commit
7d9071d
·
1 Parent(s): 07e8cae

Upload with huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +1 -2
  2. run.py +31 -0
README.md CHANGED
@@ -6,7 +6,6 @@ colorFrom: indigo
6
  colorTo: indigo
7
  sdk: gradio
8
  sdk_version: 3.4.1
9
-
10
- app_file: app.py
11
  pinned: false
12
  ---
 
6
  colorTo: indigo
7
  sdk: gradio
8
  sdk_version: 3.4.1
9
+ app_file: run.py
 
10
  pinned: false
11
  ---
run.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+
4
+ def greet(str):
5
+ return str
6
+
7
+
8
+ with gr.Blocks() as demo:
9
+ """
10
+ You can make use of str shortcuts you use in Interface within Blocks as well.
11
+
12
+ Interface shortcut example:
13
+ Interface(greet, "textarea", "textarea")
14
+
15
+ You can use
16
+ 1. gr.component()
17
+ 2. gr.templates.Template()
18
+ 3. gr.Template()
19
+ All the templates are listed in gradio/templates.py
20
+ """
21
+ with gr.Row():
22
+ text1 = gr.component("textarea")
23
+ text2 = gr.TextArea()
24
+ text3 = gr.templates.TextArea()
25
+ text1.blur(greet, text1, text2)
26
+ text2.blur(greet, text2, text3)
27
+ text3.blur(greet, text3, text1)
28
+ button = gr.component("button")
29
+
30
+ if __name__ == "__main__":
31
+ demo.launch()