Spaces:
Runtime error
Runtime error
Upload with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -5,7 +5,7 @@ emoji: 🔥
|
|
| 5 |
colorFrom: indigo
|
| 6 |
colorTo: indigo
|
| 7 |
sdk: gradio
|
| 8 |
-
sdk_version: 3.
|
| 9 |
app_file: run.py
|
| 10 |
pinned: false
|
| 11 |
---
|
|
|
|
| 5 |
colorFrom: indigo
|
| 6 |
colorTo: indigo
|
| 7 |
sdk: gradio
|
| 8 |
+
sdk_version: 3.11.0
|
| 9 |
app_file: run.py
|
| 10 |
pinned: false
|
| 11 |
---
|
run.ipynb
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: blocks_essay_update"]}, {"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", "def change_textbox(choice):\n", " if choice == \"short\":\n", " return gr.update(lines=2, visible=True, value=\"Short story: \")\n", " elif choice == \"long\":\n", " return gr.update(lines=8, visible=True, value=\"Long story...\")\n", " else:\n", " return gr.update(visible=False)\n", "\n", "with gr.Blocks() as demo:\n", " radio = gr.Radio(\n", " [\"short\", \"long\", \"none\"], label=\"Essay Length to Write?\"\n", " )\n", " text = gr.Textbox(lines=2, interactive=True)\n", " radio.change(fn=change_textbox, inputs=radio, outputs=text)\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|