Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- README.md +7 -7
- requirements.txt +2 -0
- run.ipynb +1 -0
- run.py +20 -0
- screenshot.gif +0 -0
README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
sdk_version: 5.9.1
|
8 |
-
app_file:
|
9 |
pinned: false
|
|
|
10 |
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
+
|
2 |
---
|
3 |
+
title: render_visibility_main
|
4 |
+
emoji: 🔥
|
5 |
+
colorFrom: indigo
|
6 |
+
colorTo: indigo
|
7 |
sdk: gradio
|
8 |
sdk_version: 5.9.1
|
9 |
+
app_file: run.py
|
10 |
pinned: false
|
11 |
+
hf_oauth: true
|
12 |
---
|
|
|
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
gradio-client @ git+https://github.com/gradio-app/gradio@4fc7fb777c42af537e4af612423fa44029657d41#subdirectory=client/python
|
2 |
+
https://gradio-pypi-previews.s3.amazonaws.com/4fc7fb777c42af537e4af612423fa44029657d41/gradio-5.9.1-py3-none-any.whl
|
run.ipynb
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: render_visibility"]}, {"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", "\n", "\n", "def greet(name):\n", " return \"Hello \" + name + \"!\"\n", "\n", "\n", "with gr.Blocks() as demo:\n", " with gr.Tabs():\n", " with gr.TabItem(\"Tab 1\"):\n", " t = gr.Textbox(\"Some value\", label=\"Name\", visible=False)\n", " btn = gr.Button(\"Show\")\n", " btn.click(lambda: gr.Textbox(visible=True), inputs=None, outputs=t)\n", " with gr.TabItem(\"Tab 2\"):\n", " t2 = gr.Textbox(\"Some other value\", label=\"Name\", visible=False)\n", " btn2 = gr.Button(\"Show\")\n", " btn2.click(lambda: gr.Textbox(visible=True), inputs=None, outputs=t2)\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|
run.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
|
4 |
+
def greet(name):
|
5 |
+
return "Hello " + name + "!"
|
6 |
+
|
7 |
+
|
8 |
+
with gr.Blocks() as demo:
|
9 |
+
with gr.Tabs():
|
10 |
+
with gr.TabItem("Tab 1"):
|
11 |
+
t = gr.Textbox("Some value", label="Name", visible=False)
|
12 |
+
btn = gr.Button("Show")
|
13 |
+
btn.click(lambda: gr.Textbox(visible=True), inputs=None, outputs=t)
|
14 |
+
with gr.TabItem("Tab 2"):
|
15 |
+
t2 = gr.Textbox("Some other value", label="Name", visible=False)
|
16 |
+
btn2 = gr.Button("Show")
|
17 |
+
btn2.click(lambda: gr.Textbox(visible=True), inputs=None, outputs=t2)
|
18 |
+
|
19 |
+
if __name__ == "__main__":
|
20 |
+
demo.launch()
|
screenshot.gif
ADDED
![]() |