Spaces:
Running
Running
File size: 981 Bytes
f21eab9 |
1 |
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: deep_link"]}, {"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", "\n", "def random_response(message, history):\n", " return random.choice([\"Hi!\", \"Hello!\", \"Greetings!\"])\n", "\n", "with gr.Blocks() as demo:\n", " gr.ChatInterface(\n", " random_response,\n", " title=\"Greeting Bot\",\n", " description=\"Ask anything and receive a nice greeting!\",\n", " )\n", " gr.DeepLinkButton()\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch(share=True)\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} |