Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- requirements.txt +2 -2
- run.ipynb +1 -1
- run.py +1 -1
requirements.txt
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
gradio-client @ git+https://github.com/gradio-app/gradio@
|
2 |
-
https://gradio-builds.s3.amazonaws.com/
|
|
|
1 |
+
gradio-client @ git+https://github.com/gradio-app/gradio@716bf94ff585729afb086260c76774c8f26eaa18#subdirectory=client/python
|
2 |
+
https://gradio-builds.s3.amazonaws.com/716bf94ff585729afb086260c76774c8f26eaa18/gradio-4.39.0-py3-none-any.whl
|
run.ipynb
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: timer_simple"]}, {"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 random\n", "import time\n", "\n", "with gr.Blocks() as demo:\n", " timer = gr.Timer(1)\n", " timestamp = gr.Number(label=\"Time\")\n", " timer.tick(lambda: round(time.time()), outputs=timestamp)\n", "\n", " number = gr.Number(lambda: random.randint(1, 10), every=timer, label=\"Random Number\")\n", " with gr.Row():\n", " gr.Button(\"Start\").click(lambda: gr.Timer(active=True), None, timer)\n", " gr.Button(\"Stop\").click(lambda: gr.Timer(active=False), None, timer)\n", " gr.Button(\"Go Fast\").click(0.2, None, timer)\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|
|
|
1 |
+
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: timer_simple"]}, {"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 random\n", "import time\n", "\n", "with gr.Blocks() as demo:\n", " timer = gr.Timer(1)\n", " timestamp = gr.Number(label=\"Time\")\n", " timer.tick(lambda: round(time.time()), outputs=timestamp)\n", "\n", " number = gr.Number(lambda: random.randint(1, 10), every=timer, label=\"Random Number\")\n", " with gr.Row():\n", " gr.Button(\"Start\").click(lambda: gr.Timer(active=True), None, timer)\n", " gr.Button(\"Stop\").click(lambda: gr.Timer(active=False), None, timer)\n", " gr.Button(\"Go Fast\").click(lambda: 0.2, None, timer)\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|
run.py
CHANGED
@@ -11,7 +11,7 @@ with gr.Blocks() as demo:
|
|
11 |
with gr.Row():
|
12 |
gr.Button("Start").click(lambda: gr.Timer(active=True), None, timer)
|
13 |
gr.Button("Stop").click(lambda: gr.Timer(active=False), None, timer)
|
14 |
-
gr.Button("Go Fast").click(0.2, None, timer)
|
15 |
|
16 |
if __name__ == "__main__":
|
17 |
demo.launch()
|
|
|
11 |
with gr.Row():
|
12 |
gr.Button("Start").click(lambda: gr.Timer(active=True), None, timer)
|
13 |
gr.Button("Stop").click(lambda: gr.Timer(active=False), None, timer)
|
14 |
+
gr.Button("Go Fast").click(lambda: 0.2, None, timer)
|
15 |
|
16 |
if __name__ == "__main__":
|
17 |
demo.launch()
|