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-pypi-previews.s3.amazonaws.com/
|
|
|
|
| 1 |
+
gradio-client @ git+https://github.com/gradio-app/gradio@d68c663fc9fffed4840fd74bed940fba3e2bc174#subdirectory=client/python
|
| 2 |
+
https://gradio-pypi-previews.s3.amazonaws.com/d68c663fc9fffed4840fd74bed940fba3e2bc174/gradio-5.42.0-py3-none-any.whl
|
run.ipynb
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: reload_mode"]}, {"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": ["# Downloading files from the demo repo\n", "import os\n", "!wget -q https://github.com/gradio-app/gradio/raw/main/demo/reload_mode/functions.py"]}, {"cell_type": "code", "execution_count": null, "id": "44380577570523278879349135829904343037", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "from functions import get_status\n", "\n", "if gr.NO_RELOAD:\n", " def eat(food): # type: ignore\n", " if food > 0:\n", " return {food_box: food - 1, status_box: \"full\"}\n", " else:\n", " return {status_box: \"hungry\"}\n", "else:\n", " def eat(food):\n", " return {status_box: get_status()}\n", "\n", "\n", "with gr.Blocks() as demo:\n", " food_box = gr.Number(value=10, label=\"Food Count!!\")\n", " status_box = gr.Textbox(label=\"Status\")\n", "\n", " gr.Button(\"Eat\").click(fn=eat,\n", " inputs=food_box,\n", " outputs=[food_box, status_box])\n", "\n", "demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|
|
|
|
| 1 |
+
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: reload_mode"]}, {"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": ["# Downloading files from the demo repo\n", "import os\n", "!wget -q https://github.com/gradio-app/gradio/raw/main/demo/reload_mode/functions.py"]}, {"cell_type": "code", "execution_count": null, "id": "44380577570523278879349135829904343037", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "from functions import get_status # type: ignore\n", "\n", "if gr.NO_RELOAD:\n", " def eat(food): # type: ignore\n", " if food > 0:\n", " return {food_box: food - 1, status_box: \"full\"}\n", " else:\n", " return {status_box: \"hungry\"}\n", "else:\n", " def eat(food):\n", " return {status_box: get_status()}\n", "\n", "\n", "with gr.Blocks() as demo:\n", " food_box = gr.Number(value=10, label=\"Food Count!!\")\n", " status_box = gr.Textbox(label=\"Status\")\n", "\n", " gr.Button(\"Eat\").click(fn=eat,\n", " inputs=food_box,\n", " outputs=[food_box, status_box])\n", "\n", "demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|
run.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from functions import get_status
|
| 3 |
|
| 4 |
if gr.NO_RELOAD:
|
| 5 |
def eat(food): # type: ignore
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from functions import get_status # type: ignore
|
| 3 |
|
| 4 |
if gr.NO_RELOAD:
|
| 5 |
def eat(food): # type: ignore
|