File size: 1,322 Bytes
7d6389f
1
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: rows_and_columns"]}, {"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", "with gr.Blocks() as demo:\n", "    with gr.Row():\n", "        text1 = gr.Textbox(label=\"t1\")\n", "        slider2 = gr.Textbox(label=\"s2\")\n", "        drop3 = gr.Dropdown([\"a\", \"b\", \"c\"], label=\"d3\")\n", "    with gr.Row():\n", "        with gr.Column(scale=1, min_width=300):\n", "            text1 = gr.Textbox(label=\"prompt 1\")\n", "            text2 = gr.Textbox(label=\"prompt 2\")\n", "            inbtw = gr.Button(\"Between\")\n", "            text4 = gr.Textbox(label=\"prompt 1\")\n", "            text5 = gr.Textbox(label=\"prompt 2\")\n", "        with gr.Column(scale=2, min_width=300):\n", "            img1 = gr.Image(\"images/cheetah.jpg\")\n", "            btn = gr.Button(\"Go\")\n", "\n", "if __name__ == \"__main__\":\n", "    demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}