aliabd HF staff commited on
Commit
c73cee7
·
1 Parent(s): 290cef7

Upload with huggingface_hub

Browse files
Files changed (4) hide show
  1. README.md +6 -7
  2. requirements.txt +2 -0
  3. run.ipynb +1 -0
  4. run.py +19 -0
README.md CHANGED
@@ -1,12 +1,11 @@
 
1
  ---
2
- title: Theme Soft Main
3
- emoji: 😻
4
- colorFrom: gray
5
- colorTo: green
6
  sdk: gradio
7
  sdk_version: 3.21.0
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: theme_soft_main
4
+ emoji: 🔥
5
+ colorFrom: indigo
6
+ colorTo: indigo
7
  sdk: gradio
8
  sdk_version: 3.21.0
9
+ app_file: run.py
10
  pinned: false
11
  ---
 
 
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+
2
+ https://gradio-main-build.s3.amazonaws.com/8114202697ef4d35c757f0f879e5457a35a16bf5/gradio-3.21.0-py3-none-any.whl
run.ipynb ADDED
@@ -0,0 +1 @@
 
 
1
+ {"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: theme_soft"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "import time\n", "\n", "with gr.Blocks(theme=gr.themes.Soft()) as demo:\n", " textbox = gr.Textbox(label=\"Name\")\n", " slider = gr.Slider(label=\"Count\", minimum=0, maximum=100, step=1)\n", " with gr.Row():\n", " button = gr.Button(\"Submit\", variant=\"primary\")\n", " clear = gr.Button(\"Clear\")\n", " output = gr.Textbox(label=\"Output\")\n", "\n", " def repeat(name, count):\n", " time.sleep(3)\n", " return name * count\n", " \n", " button.click(repeat, [textbox, slider], output)\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
run.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import time
3
+
4
+ with gr.Blocks(theme=gr.themes.Soft()) as demo:
5
+ textbox = gr.Textbox(label="Name")
6
+ slider = gr.Slider(label="Count", minimum=0, maximum=100, step=1)
7
+ with gr.Row():
8
+ button = gr.Button("Submit", variant="primary")
9
+ clear = gr.Button("Clear")
10
+ output = gr.Textbox(label="Output")
11
+
12
+ def repeat(name, count):
13
+ time.sleep(3)
14
+ return name * count
15
+
16
+ button.click(repeat, [textbox, slider], output)
17
+
18
+ if __name__ == "__main__":
19
+ demo.launch()