{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: upload_file_limit_test"]}, {"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", " gr.Markdown(\"\"\"\n", " # \u2b06\ufe0f\ud83d\udcc1 max_file_size test\n", " The demo has a max file size of 15kb. The error modal should pop up when a file larger than that is uploaded. \n", " \"\"\")\n", " with gr.Row():\n", " with gr.Column():\n", " gr.Image(label=\"Image\", interactive=True)\n", " gr.Gallery(label=\"Gallery\", interactive=True)\n", " gr.File(label=\"Single File\", interactive=True, file_count=\"single\")\n", " with gr.Column():\n", " gr.Model3D(label=\"Model 3D\", interactive=True,)\n", " gr.MultimodalTextbox(label=\"Multimodal Textbox\", interactive=True)\n", " gr.UploadButton(label=\"Upload Button\", interactive=True)\n", " with gr.Column():\n", " gr.Video(label=\"Video\", interactive=True)\n", " gr.Audio(label=\"Audio\", interactive=True)\n", " gr.File(label=\"Multiple Files\", interactive=True, file_count=\"multiple\")\n", "\n", "if __name__ == \"__main__\":\n", " # The upload limit is set in playwright_setup.js\n", " # since the e2e tests use mount_gradio_app\n", " demo.launch(max_file_size=\"15kb\")\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}