[{"gradio":"v3.21.0\nmain\n\nNew to Gradio? Start here: Getting Started\n\nSee the Release History\n\nBuilding Demos \nInterface\nTry Examples\ngradio.Interface(fn, inputs, outputs, ···)\n\nInterface is Gradio's main high-level class, and allows you to create a web-based GUI / demo around a machine learning model (or any Python function) in a few lines of code. You must specify three parameters: (1) the function to create a GUI for (2) the desired input components and (3) the desired output components. Additional parameters can be used to control the appearance and behavior of the demo.\n\n\n\n\nExample Usage\nimport gradio as gr\n\ndef image_classifier(inp):\n return {'cat': 0.3, 'dog': 0.7}\n\ndemo = gr.Interface(fn=image_classifier, inputs=\"image\", outputs=\"label\")\ndemo.launch()\nMore Examples →\nParameter\tDescription\n\nfn\n\nCallable\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nstr | IOComponent | List[str | IOComponent] | None\n\nrequired\n\n\t\n\na single Gradio component, or list of Gradio components. Components can either be passed as instantiated objects, or referred to by their string shortcuts. The number of input components should match the number of parameters in fn. If set to None, then only the output components will be displayed.\n\n\n\noutputs\n\nstr | IOComponent | List[str | IOComponent] | None\n\nrequired\n\n\t\n\na single Gradio component, or list of Gradio components. Components can either be passed as instantiated objects, or referred to by their string shortcuts. The number of output components should match the number of values returned by fn. If set to None, then only the input components will be displayed.\n\n\n\nexamples\n\nList[Any] | List[List[Any]] | str | None\n\ndefault: None\n\n\t\n\nsample inputs for the function; if provided, appear below the UI components and can be clicked to populate the interface. Should be nested list, in which the outer list consists of samples and each inner list consists of an input corresponding to each input component. A string path to a directory of examples can also be provided, but it should be within the directory with the python file running the gradio app. If there are multiple input components and a directory is provided, a log.csv file must be present in the directory to link corresponding inputs.\n\n\n\ncache_examples\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, caches examples in the server for fast runtime in examples. The default option in HuggingFace Spaces is True. The default option elsewhere is False.\n\n\n\nexamples_per_page\n\nint\n\ndefault: 10\n\n\t\n\nIf examples are provided, how many to display per page.\n\n\n\nlive\n\nbool\n\ndefault: False\n\n\t\n\nwhether the interface should automatically rerun if any of the inputs change.\n\n\n\ninterpretation\n\nCallable | str | None\n\ndefault: None\n\n\t\n\nfunction that provides interpretation explaining prediction output. Pass \"default\" to use simple built-in interpreter, \"shap\" to use a built-in shapley-based interpreter, or your own custom interpretation function. For more information on the different interpretation methods, see the Advanced Interface Features guide.\n\n\n\nnum_shap\n\nfloat\n\ndefault: 2.0\n\n\t\n\na multiplier that determines how many examples are computed for shap-based interpretation. Increasing this value will increase shap runtime, but improve results. Only applies if interpretation is \"shap\".\n\n\n\ntitle\n\nstr | None\n\ndefault: None\n\n\t\n\na title for the interface; if provided, appears above the input and output components in large font. Also used as the tab title when opened in a browser window.\n\n\n\ndescription\n\nstr | None\n\ndefault: None\n\n\t\n\na description for the interface; if provided, appears above the input and output components and beneath the title in regular font. Accepts Markdown and HTML content.\n\n\n\narticle\n\nstr | None\n\ndefault: None\n\n\t\n\nan expanded article explaining the interface; if provided, appears below the input and output components in regular font. Accepts Markdown and HTML content.\n\n\n\nthumbnail\n\nstr | None\n\ndefault: None\n\n\t\n\npath or url to image to use as display image when the web demo is shared on social media.\n\n\n\ntheme\n\nTheme | None\n\ndefault: None\n\n\t\n\nTheme to use, loaded from gradio.themes.\n\n\n\ncss\n\nstr | None\n\ndefault: None\n\n\t\n\ncustom css or path to custom css file to use with interface.\n\n\n\nallow_flagging\n\nstr | None\n\ndefault: None\n\n\t\n\none of \"never\", \"auto\", or \"manual\". If \"never\" or \"auto\", users will not see a button to flag an input and output. If \"manual\", users will see a button to flag. If \"auto\", every input the user submits will be automatically flagged (outputs are not flagged). If \"manual\", both the input and outputs are flagged when the user clicks flag button. This parameter can be set with environmental variable GRADIO_ALLOW_FLAGGING; otherwise defaults to \"manual\".\n\n\n\nflagging_options\n\nList[str] | List[Tuple[str, str]] | None\n\ndefault: None\n\n\t\n\nif provided, allows user to select from the list of options when flagging. Only applies if allow_flagging is \"manual\". Can either be a list of tuples of the form (label, value), where label is the string that will be displayed on the button and value is the string that will be stored in the flagging CSV; or it can be a list of strings [\"X\", \"Y\"], in which case the values will be the list of strings and the labels will [\"Flag as X\", \"Flag as Y\"], etc.\n\n\n\nflagging_dir\n\nstr\n\ndefault: \"flagged\"\n\n\t\n\nwhat to name the directory where flagged data is stored.\n\n\n\nflagging_callback\n\nFlaggingCallback\n\ndefault: CSVLogger()\n\n\t\n\nAn instance of a subclass of FlaggingCallback which will be called when a sample is flagged. By default logs to a local CSV file.\n\n\n\nanalytics_enabled\n\nbool | None\n\ndefault: None\n\n\t\n\nWhether to allow basic telemetry. If None, will use GRADIO_ANALYTICS_ENABLED environment variable if defined, or default to True.\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\nMethods\nlaunch\ngradio.Interface.launch(···)\n\nLaunches a simple web server that serves the demo. Can also be used to create a public link used by anyone to access the demo from their browser by setting share=True.\n\n\n\n\nExample Usage\nimport gradio as gr\ndef reverse(text):\n return text[::-1]\ndemo = gr.Interface(reverse, \"text\", \"text\")\ndemo.launch(share=True, auth=(\"username\", \"password\"))\nParameter\tDescription\n\ninline\n\nbool | None\n\ndefault: None\n\n\t\n\nwhether to display in the interface inline in an iframe. Defaults to True in python notebooks; False otherwise.\n\n\n\ninbrowser\n\nbool\n\ndefault: False\n\n\t\n\nwhether to automatically launch the interface in a new tab on the default browser.\n\n\n\nshare\n\nbool | None\n\ndefault: None\n\n\t\n\nwhether to create a publicly shareable link for the interface. Creates an SSH tunnel to make your UI accessible from anywhere. If not provided, it is set to False by default every time, except when running in Google Colab. When localhost is not accessible (e.g. Google Colab), setting share=False is not supported.\n\n\n\ndebug\n\nbool\n\ndefault: False\n\n\t\n\nif True, blocks the main thread from running. If running in Google Colab, this is needed to print the errors in the cell output.\n\n\n\nenable_queue\n\nbool | None\n\ndefault: None\n\n\t\n\nDEPRECATED (use .queue() method instead.) if True, inference requests will be served through a queue instead of with parallel threads. Required for longer inference times (> 1min) to prevent timeout. The default option in HuggingFace Spaces is True. The default option elsewhere is False.\n\n\n\nmax_threads\n\nint\n\ndefault: 40\n\n\t\n\nthe maximum number of total threads that the Gradio app can generate in parallel. The default is inherited from the starlette library (currently 40). Applies whether the queue is enabled or not. But if queuing is enabled, this parameter is increaseed to be at least the concurrency_count of the queue.\n\n\n\nauth\n\nCallable | Tuple[str, str] | List[Tuple[str, str]] | None\n\ndefault: None\n\n\t\n\nIf provided, username and password (or list of username-password tuples) required to access interface. Can also provide function that takes username and password and returns True if valid login.\n\n\n\nauth_message\n\nstr | None\n\ndefault: None\n\n\t\n\nIf provided, HTML message provided on login page.\n\n\n\nprevent_thread_lock\n\nbool\n\ndefault: False\n\n\t\n\nIf True, the interface will block the main thread while the server is running.\n\n\n\nshow_error\n\nbool\n\ndefault: False\n\n\t\n\nIf True, any errors in the interface will be displayed in an alert modal and printed in the browser console log\n\n\n\nserver_name\n\nstr | None\n\ndefault: None\n\n\t\n\nto make app accessible on local network, set this to \"0.0.0.0\". Can be set by environment variable GRADIO_SERVER_NAME. If None, will use \"127.0.0.1\".\n\n\n\nserver_port\n\nint | None\n\ndefault: None\n\n\t\n\nwill start gradio app on this port (if available). Can be set by environment variable GRADIO_SERVER_PORT. If None, will search for an available port starting at 7860.\n\n\n\nshow_tips\n\nbool\n\ndefault: False\n\n\t\n\nif True, will occasionally show tips about new Gradio features\n\n\n\nheight\n\nint\n\ndefault: 500\n\n\t\n\nThe height in pixels of the iframe element containing the interface (used if inline=True)\n\n\n\nwidth\n\nint | str\n\ndefault: \"100%\"\n\n\t\n\nThe width in pixels of the iframe element containing the interface (used if inline=True)\n\n\n\nencrypt\n\nbool | None\n\ndefault: None\n\n\t\n\nDEPRECATED. Has no effect.\n\n\n\nfavicon_path\n\nstr | None\n\ndefault: None\n\n\t\n\nIf a path to a file (.png, .gif, or .ico) is provided, it will be used as the favicon for the web page.\n\n\n\nssl_keyfile\n\nstr | None\n\ndefault: None\n\n\t\n\nIf a path to a file is provided, will use this as the private key file to create a local server running on https.\n\n\n\nssl_certfile\n\nstr | None\n\ndefault: None\n\n\t\n\nIf a path to a file is provided, will use this as the signed certificate for https. Needs to be provided if ssl_keyfile is provided.\n\n\n\nssl_keyfile_password\n\nstr | None\n\ndefault: None\n\n\t\n\nIf a password is provided, will use this with the ssl certificate for https.\n\n\n\nquiet\n\nbool\n\ndefault: False\n\n\t\n\nIf True, suppresses most print statements.\n\n\n\nshow_api\n\nbool\n\ndefault: True\n\n\t\n\nIf True, shows the api docs in the footer of the app. Default True. If the queue is enabled, then api_open parameter of .queue() will determine if the api docs are shown, independent of the value of show_api.\n\n\n\nfile_directories\n\nList[str] | None\n\ndefault: None\n\n\t\n\nList of directories that gradio is allowed to serve files from (in addition to the directory containing the gradio python file). Must be absolute paths. Warning: any files in these directories or its children are potentially accessible to all users of your app.\n\nload\ngradio.Interface.load(name, ···)\n\nClass method that constructs an Interface from a Hugging Face repo. Can accept model repos (if src is \"models\") or Space repos (if src is \"spaces\"). The input and output components are automatically loaded from the repo.\n\n\n\nExample Usage\nimport gradio as gr\ndescription = \"Story generation with GPT\"\nexamples = [[\"An adventurer is approached by a mysterious stranger in the tavern for a new quest.\"]]\ndemo = gr.Interface.load(\"models/EleutherAI/gpt-neo-1.3B\", description=description, examples=examples)\ndemo.launch()\nParameter\tDescription\n\nname\n\nstr\n\nrequired\n\n\t\n\nthe name of the model (e.g. \"gpt2\" or \"facebook/bart-base\") or space (e.g. \"flax-community/spanish-gpt2\"), can include the `src` as prefix (e.g. \"models/facebook/bart-base\")\n\n\n\nsrc\n\nstr | None\n\ndefault: None\n\n\t\n\nthe source of the model: `models` or `spaces` (or leave empty if source is provided as a prefix in `name`)\n\n\n\napi_key\n\nstr | None\n\ndefault: None\n\n\t\n\noptional access token for loading private Hugging Face Hub models or spaces. Find your token here: https://huggingface.co/settings/tokens\n\n\n\nalias\n\nstr | None\n\ndefault: None\n\n\t\n\noptional string used as the name of the loaded model instead of the default name (only applies if loading a Space running Gradio 2.x)\n\nfrom_pipeline\ngradio.Interface.from_pipeline(pipeline, ···)\n\nClass method that constructs an Interface from a Hugging Face transformers.Pipeline object. The input and output components are automatically determined from the pipeline.\n\n\n\nExample Usage\nimport gradio as gr\nfrom transformers import pipeline\npipe = pipeline(\"image-classification\")\ngr.Interface.from_pipeline(pipe).launch()\nParameter\tDescription\n\npipeline\n\nPipeline\n\nrequired\n\n\t\n\nthe pipeline object to use.\n\nintegrate\ngradio.Interface.integrate(···)\n\nA catch-all method for integrating with other libraries. This method should be run after launch()\n\n\n\nParameter\tDescription\n\ncomet_ml\n\ncomet_ml.Experiment | None\n\ndefault: None\n\n\t\n\nIf a comet_ml Experiment object is provided, will integrate with the experiment and appear on Comet dashboard\n\n\n\nwandb\n\nModuleType | None\n\ndefault: None\n\n\t\n\nIf the wandb module is provided, will integrate with it and appear on WandB dashboard\n\n\n\nmlflow\n\nModuleType | None\n\ndefault: None\n\n\t\n\nIf the mlflow module is provided, will integrate with the experiment and appear on ML Flow dashboard\n\nqueue\ngradio.Interface.queue(···)\n\nYou can control the rate of processed requests by creating a queue. This will allow you to set the number of requests to be processed at one time, and will let users know their position in the queue.\n\n\n\nExample Usage\ndemo = gr.Interface(image_generator, gr.Textbox(), gr.Image())\ndemo.queue(concurrency_count=3)\ndemo.launch()\nParameter\tDescription\n\nconcurrency_count\n\nint\n\ndefault: 1\n\n\t\n\nNumber of worker threads that will be processing requests from the queue concurrently. Increasing this number will increase the rate at which requests are processed, but will also increase the memory usage of the queue.\n\n\n\nstatus_update_rate\n\nfloat | Literal['auto']\n\ndefault: \"auto\"\n\n\t\n\nIf \"auto\", Queue will send status estimations to all clients whenever a job is finished. Otherwise Queue will send status at regular intervals set by this parameter as the number of seconds.\n\n\n\nclient_position_to_load_data\n\nint | None\n\ndefault: None\n\n\t\n\nDEPRECATED. This parameter is deprecated and has no effect.\n\n\n\ndefault_enabled\n\nbool | None\n\ndefault: None\n\n\t\n\nDeprecated and has no effect.\n\n\n\napi_open\n\nbool\n\ndefault: True\n\n\t\n\nIf True, the REST routes of the backend will be open, allowing requests made directly to those endpoints to skip the queue.\n\n\n\nmax_size\n\nint | None\n\ndefault: None\n\n\t\n\nThe maximum number of events the queue will store at any given moment. If the queue is full, new events will not be added and a user will receive a message saying that the queue is full. If None, the queue size will be unlimited.\n\nStep-by-step Guides\n\nQuickstart\n\nFlagging \n\nA Gradio Interface includes a \"Flag\" button that appears underneath the output. By default, clicking on the Flag button sends the input and output data back to the machine where the gradio demo is running, and saves it to a CSV log file. But this default behavior can be changed. To set what happens when the Flag button is clicked, you pass an instance of a subclass of FlaggingCallback to the flagging_callback parameter in the Interface constructor. You can use one of the FlaggingCallback subclasses that are listed below, or you can create your own, which lets you do whatever you want with the data that is being flagged.\n\nSimpleCSVLogger\ngradio.SimpleCSVLogger(···)\n\nA simplified implementation of the FlaggingCallback abstract class provided for illustrative purposes. Each flagged sample (both the input and output data) is logged to a CSV file on the machine running the gradio app.\n\n\n\nExample Usage\nimport gradio as gr\ndef image_classifier(inp):\n return {'cat': 0.3, 'dog': 0.7}\ndemo = gr.Interface(fn=image_classifier, inputs=\"image\", outputs=\"label\",\n flagging_callback=SimpleCSVLogger())\nStep-by-step Guides\n\nNo guides yet, contribute a guide about SimpleCSVLogger\n\nCSVLogger\ngradio.CSVLogger(···)\n\nThe default implementation of the FlaggingCallback abstract class. Each flagged sample (both the input and output data) is logged to a CSV file with headers on the machine running the gradio app.\n\n\n\nExample Usage\nimport gradio as gr\ndef image_classifier(inp):\n return {'cat': 0.3, 'dog': 0.7}\ndemo = gr.Interface(fn=image_classifier, inputs=\"image\", outputs=\"label\",\n flagging_callback=CSVLogger())\nStep-by-step Guides\n\nNo guides yet, contribute a guide about CSVLogger\n\nHuggingFaceDatasetSaver\ngradio.HuggingFaceDatasetSaver(hf_token, dataset_name, ···)\n\nA callback that saves each flagged sample (both the input and output data) to a HuggingFace dataset.\n\n\n\nExample Usage\nimport gradio as gr\nhf_writer = gr.HuggingFaceDatasetSaver(HF_API_TOKEN, \"image-classification-mistakes\")\ndef image_classifier(inp):\n return {'cat': 0.3, 'dog': 0.7}\ndemo = gr.Interface(fn=image_classifier, inputs=\"image\", outputs=\"label\",\n allow_flagging=\"manual\", flagging_callback=hf_writer)\nParameter\tDescription\n\nhf_token\n\nstr\n\nrequired\n\n\t\n\nThe HuggingFace token to use to create (and write the flagged sample to) the HuggingFace dataset.\n\n\n\ndataset_name\n\nstr\n\nrequired\n\n\t\n\nThe name of the dataset to save the data to, e.g. \"image-classifier-1\"\n\n\n\norganization\n\nstr | None\n\ndefault: None\n\n\t\n\nThe organization to save the dataset under. The hf_token must provide write access to this organization. If not provided, saved under the name of the user corresponding to the hf_token.\n\n\n\nprivate\n\nbool\n\ndefault: False\n\n\t\n\nWhether the dataset should be private (defaults to False).\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about HuggingFaceDatasetSaver\n\nCombining Interfaces \n\nOnce you have created several Interfaces, we provide several classes that let you start combining them together. For example, you can chain them in Series or compare their outputs in Parallel if the inputs and outputs match accordingly. You can also display arbitrary Interfaces together in a tabbed layout using TabbedInterface.\n\nTabbedInterface\nTry Examples\ngradio.TabbedInterface(interface_list, ···)\n\nA TabbedInterface is created by providing a list of Interfaces, each of which gets rendered in a separate tab.\n\n\n\nimport gradio as gr\n\ntitle = \"GPT-J-6B\"\n\ntts_examples = [\n \"I love learning machine learning\",\n \"How do you do?\",\n]\n\ntts_demo = gr.Interface.load(\n \"huggingface/facebook/fastspeech2-en-ljspeech\",\n title=None,\n examples=tts_examples,\n description=\"Give me something to say!\",\n)\n\nstt_demo = gr.Interface.load(\n \"huggingface/facebook/wav2vec2-base-960h\",\n title=None,\n inputs=\"mic\",\n description=\"Let me try to guess what you're saying!\",\n)\n\ndemo = gr.TabbedInterface([tts_demo, stt_demo], [\"Text-to-speech\", \"Speech-to-text\"])\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\ninterface_list\n\nList[Interface]\n\nrequired\n\n\t\n\na list of interfaces to be rendered in tabs.\n\n\n\ntab_names\n\nList[str] | None\n\ndefault: None\n\n\t\n\na list of tab names. If None, the tab names will be \"Tab 1\", \"Tab 2\", etc.\n\n\n\ntitle\n\nstr | None\n\ndefault: None\n\n\t\n\na title for the interface; if provided, appears above the input and output components in large font. Also used as the tab title when opened in a browser window.\n\n\n\ntheme\n\nTheme | None\n\ndefault: None\n\n\t\n\n\n\nanalytics_enabled\n\nbool | None\n\ndefault: None\n\n\t\n\nwhether to allow basic telemetry. If None, will use GRADIO_ANALYTICS_ENABLED environment variable or default to True.\n\n\n\ncss\n\nstr | None\n\ndefault: None\n\n\t\n\ncustom css or path to custom css file to apply to entire Blocks\n\nParallel\nTry Examples\ngradio.Parallel(interfaces, ···)\n\nCreates a new Interface consisting of multiple Interfaces in parallel (comparing their outputs). The Interfaces to put in Parallel must share the same input components (but can have different output components).\n\n\n\n\nimport gradio as gr\n\ngreeter_1 = gr.Interface(lambda name: f\"Hello {name}!\", inputs=\"textbox\", outputs=gr.Textbox(label=\"Greeter 1\"))\ngreeter_2 = gr.Interface(lambda name: f\"Greetings {name}!\", inputs=\"textbox\", outputs=gr.Textbox(label=\"Greeter 2\"))\ndemo = gr.Parallel(greeter_1, greeter_2)\n\nif __name__ == \"__main__\":\n demo.launch()\nTry Examples\nParameter\tDescription\n\ninterfaces\n\nrequired\n\n\t\n\nany number of Interface objects that are to be compared in parallel\n\n\n\noptions\n\n\t\n\nadditional kwargs that are passed into the new Interface object to customize it\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Parallel\n\nSeries\nTry Examples\ngradio.Series(interfaces, ···)\n\nCreates a new Interface from multiple Interfaces in series (the output of one is fed as the input to the next, and so the input and output components must agree between the interfaces).\n\n\n\n\nimport gradio as gr\n\nget_name = gr.Interface(lambda name: name, inputs=\"textbox\", outputs=\"textbox\")\nprepend_hello = gr.Interface(lambda name: f\"Hello {name}!\", inputs=\"textbox\", outputs=\"textbox\")\nappend_nice = gr.Interface(lambda greeting: f\"{greeting} Nice to meet you!\",\n inputs=\"textbox\", outputs=gr.Textbox(label=\"Greeting\"))\ndemo = gr.Series(get_name, prepend_hello, append_nice)\n\nif __name__ == \"__main__\":\n demo.launch()\nTry Examples\nParameter\tDescription\n\ninterfaces\n\nrequired\n\n\t\n\nany number of Interface objects that are to be connected in series\n\n\n\noptions\n\n\t\n\nadditional kwargs that are passed into the new Interface object to customize it\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Series\n\nBlocks\nTry Examples\nwith gradio.Blocks():\n\nBlocks is Gradio's low-level API that allows you to create more custom web applications and demos than Interfaces (yet still entirely in Python).\n\nCompared to the Interface class, Blocks offers more flexibility and control over: (1) the layout of components (2) the events that trigger the execution of functions (3) data flows (e.g. inputs can trigger outputs, which can trigger the next level of outputs). Blocks also offers ways to group together related demos such as with tabs.\n\nThe basic usage of Blocks is as follows: create a Blocks object, then use it as a context (with the \"with\" statement), and then define layouts, components, or events within the Blocks context. Finally, call the launch() method to launch the demo.\n\n\n\n\nExample Usage\nimport gradio as gr\ndef update(name):\n return f\"Welcome to Gradio, {name}!\"\n\nwith gr.Blocks() as demo:\n gr.Markdown(\"Start typing below and then click **Run** to see the output.\")\n with gr.Row():\n inp = gr.Textbox(placeholder=\"What is your name?\")\n out = gr.Textbox()\n btn = gr.Button(\"Run\")\n btn.click(fn=update, inputs=inp, outputs=out)\n\ndemo.launch()\nMore Examples →\nParameter\tDescription\n\ntheme\n\nTheme | None\n\ndefault: None\n\n\t\n\n\n\nanalytics_enabled\n\nbool | None\n\ndefault: None\n\n\t\n\nwhether to allow basic telemetry. If None, will use GRADIO_ANALYTICS_ENABLED environment variable or default to True.\n\n\n\nmode\n\nstr\n\ndefault: \"blocks\"\n\n\t\n\na human-friendly name for the kind of Blocks or Interface being created.\n\n\n\ntitle\n\nstr\n\ndefault: \"Gradio\"\n\n\t\n\nThe tab title to display when this is opened in a browser window.\n\n\n\ncss\n\nstr | None\n\ndefault: None\n\n\t\n\ncustom css or path to custom css file to apply to entire Blocks\n\nMethods\nlaunch\ngradio.Blocks.launch(···)\n\nLaunches a simple web server that serves the demo. Can also be used to create a public link used by anyone to access the demo from their browser by setting share=True.\n\n\n\n\nExample Usage\nimport gradio as gr\ndef reverse(text):\n return text[::-1]\nwith gr.Blocks() as demo:\n button = gr.Button(value=\"Reverse\")\n button.click(reverse, gr.Textbox(), gr.Textbox())\ndemo.launch(share=True, auth=(\"username\", \"password\"))\nParameter\tDescription\n\ninline\n\nbool | None\n\ndefault: None\n\n\t\n\nwhether to display in the interface inline in an iframe. Defaults to True in python notebooks; False otherwise.\n\n\n\ninbrowser\n\nbool\n\ndefault: False\n\n\t\n\nwhether to automatically launch the interface in a new tab on the default browser.\n\n\n\nshare\n\nbool | None\n\ndefault: None\n\n\t\n\nwhether to create a publicly shareable link for the interface. Creates an SSH tunnel to make your UI accessible from anywhere. If not provided, it is set to False by default every time, except when running in Google Colab. When localhost is not accessible (e.g. Google Colab), setting share=False is not supported.\n\n\n\ndebug\n\nbool\n\ndefault: False\n\n\t\n\nif True, blocks the main thread from running. If running in Google Colab, this is needed to print the errors in the cell output.\n\n\n\nenable_queue\n\nbool | None\n\ndefault: None\n\n\t\n\nDEPRECATED (use .queue() method instead.) if True, inference requests will be served through a queue instead of with parallel threads. Required for longer inference times (> 1min) to prevent timeout. The default option in HuggingFace Spaces is True. The default option elsewhere is False.\n\n\n\nmax_threads\n\nint\n\ndefault: 40\n\n\t\n\nthe maximum number of total threads that the Gradio app can generate in parallel. The default is inherited from the starlette library (currently 40). Applies whether the queue is enabled or not. But if queuing is enabled, this parameter is increaseed to be at least the concurrency_count of the queue.\n\n\n\nauth\n\nCallable | Tuple[str, str] | List[Tuple[str, str]] | None\n\ndefault: None\n\n\t\n\nIf provided, username and password (or list of username-password tuples) required to access interface. Can also provide function that takes username and password and returns True if valid login.\n\n\n\nauth_message\n\nstr | None\n\ndefault: None\n\n\t\n\nIf provided, HTML message provided on login page.\n\n\n\nprevent_thread_lock\n\nbool\n\ndefault: False\n\n\t\n\nIf True, the interface will block the main thread while the server is running.\n\n\n\nshow_error\n\nbool\n\ndefault: False\n\n\t\n\nIf True, any errors in the interface will be displayed in an alert modal and printed in the browser console log\n\n\n\nserver_name\n\nstr | None\n\ndefault: None\n\n\t\n\nto make app accessible on local network, set this to \"0.0.0.0\". Can be set by environment variable GRADIO_SERVER_NAME. If None, will use \"127.0.0.1\".\n\n\n\nserver_port\n\nint | None\n\ndefault: None\n\n\t\n\nwill start gradio app on this port (if available). Can be set by environment variable GRADIO_SERVER_PORT. If None, will search for an available port starting at 7860.\n\n\n\nshow_tips\n\nbool\n\ndefault: False\n\n\t\n\nif True, will occasionally show tips about new Gradio features\n\n\n\nheight\n\nint\n\ndefault: 500\n\n\t\n\nThe height in pixels of the iframe element containing the interface (used if inline=True)\n\n\n\nwidth\n\nint | str\n\ndefault: \"100%\"\n\n\t\n\nThe width in pixels of the iframe element containing the interface (used if inline=True)\n\n\n\nencrypt\n\nbool | None\n\ndefault: None\n\n\t\n\nDEPRECATED. Has no effect.\n\n\n\nfavicon_path\n\nstr | None\n\ndefault: None\n\n\t\n\nIf a path to a file (.png, .gif, or .ico) is provided, it will be used as the favicon for the web page.\n\n\n\nssl_keyfile\n\nstr | None\n\ndefault: None\n\n\t\n\nIf a path to a file is provided, will use this as the private key file to create a local server running on https.\n\n\n\nssl_certfile\n\nstr | None\n\ndefault: None\n\n\t\n\nIf a path to a file is provided, will use this as the signed certificate for https. Needs to be provided if ssl_keyfile is provided.\n\n\n\nssl_keyfile_password\n\nstr | None\n\ndefault: None\n\n\t\n\nIf a password is provided, will use this with the ssl certificate for https.\n\n\n\nquiet\n\nbool\n\ndefault: False\n\n\t\n\nIf True, suppresses most print statements.\n\n\n\nshow_api\n\nbool\n\ndefault: True\n\n\t\n\nIf True, shows the api docs in the footer of the app. Default True. If the queue is enabled, then api_open parameter of .queue() will determine if the api docs are shown, independent of the value of show_api.\n\n\n\nfile_directories\n\nList[str] | None\n\ndefault: None\n\n\t\n\nList of directories that gradio is allowed to serve files from (in addition to the directory containing the gradio python file). Must be absolute paths. Warning: any files in these directories or its children are potentially accessible to all users of your app.\n\nqueue\ngradio.Blocks.queue(···)\n\nYou can control the rate of processed requests by creating a queue. This will allow you to set the number of requests to be processed at one time, and will let users know their position in the queue.\n\n\n\nExample Usage\nwith gr.Blocks() as demo:\n button = gr.Button(label=\"Generate Image\")\n button.click(fn=image_generator, inputs=gr.Textbox(), outputs=gr.Image())\ndemo.queue(concurrency_count=3)\ndemo.launch()\nParameter\tDescription\n\nconcurrency_count\n\nint\n\ndefault: 1\n\n\t\n\nNumber of worker threads that will be processing requests from the queue concurrently. Increasing this number will increase the rate at which requests are processed, but will also increase the memory usage of the queue.\n\n\n\nstatus_update_rate\n\nfloat | Literal['auto']\n\ndefault: \"auto\"\n\n\t\n\nIf \"auto\", Queue will send status estimations to all clients whenever a job is finished. Otherwise Queue will send status at regular intervals set by this parameter as the number of seconds.\n\n\n\nclient_position_to_load_data\n\nint | None\n\ndefault: None\n\n\t\n\nDEPRECATED. This parameter is deprecated and has no effect.\n\n\n\ndefault_enabled\n\nbool | None\n\ndefault: None\n\n\t\n\nDeprecated and has no effect.\n\n\n\napi_open\n\nbool\n\ndefault: True\n\n\t\n\nIf True, the REST routes of the backend will be open, allowing requests made directly to those endpoints to skip the queue.\n\n\n\nmax_size\n\nint | None\n\ndefault: None\n\n\t\n\nThe maximum number of events the queue will store at any given moment. If the queue is full, new events will not be added and a user will receive a message saying that the queue is full. If None, the queue size will be unlimited.\n\nintegrate\ngradio.Blocks.integrate(···)\n\nA catch-all method for integrating with other libraries. This method should be run after launch()\n\n\n\nParameter\tDescription\n\ncomet_ml\n\ncomet_ml.Experiment | None\n\ndefault: None\n\n\t\n\nIf a comet_ml Experiment object is provided, will integrate with the experiment and appear on Comet dashboard\n\n\n\nwandb\n\nModuleType | None\n\ndefault: None\n\n\t\n\nIf the wandb module is provided, will integrate with it and appear on WandB dashboard\n\n\n\nmlflow\n\nModuleType | None\n\ndefault: None\n\n\t\n\nIf the mlflow module is provided, will integrate with the experiment and appear on ML Flow dashboard\n\nload\ngradio.Blocks.load(···)\n\nFor reverse compatibility reasons, this is both a class method and an instance method, the two of which, confusingly, do two completely different things.\n\nClass method: loads a demo from a Hugging Face Spaces repo and creates it locally and returns a block instance. Equivalent to gradio.Interface.load()\n\nInstance method: adds event that runs as soon as the demo loads in the browser. Example usage below.\n\n\n\nExample Usage\nimport gradio as gr\nimport datetime\nwith gr.Blocks() as demo:\n def get_time():\n return datetime.datetime.now().time()\n dt = gr.Textbox(label=\"Current time\")\n demo.load(get_time, inputs=None, outputs=dt)\ndemo.launch()\nParameter\tDescription\n\nfn\n\nCallable | None\n\ndefault: None\n\n\t\n\nInstance Method - the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nList[Component] | None\n\ndefault: None\n\n\t\n\nInstance Method - List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nList[Component] | None\n\ndefault: None\n\n\t\n\nInstance Method - List of gradio.components to use as inputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nInstance Method - Defining this parameter exposes the endpoint in the api docs\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nInstance Method - If True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool\n\ndefault: True\n\n\t\n\nInstance Method - If True, will show progress animation while pending\n\n\n\nqueue\n\ndefault: None\n\n\t\n\nInstance Method - If True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nInstance Method - If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nInstance Method - Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nInstance Method - If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nInstance Method - If False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nInstance Method - Run this event 'every' number of seconds. Interpreted in seconds. Queue must be enabled.\n\n\n\nname\n\nstr | None\n\ndefault: None\n\n\t\n\nClass Method - the name of the model (e.g. \"gpt2\" or \"facebook/bart-base\") or space (e.g. \"flax-community/spanish-gpt2\"), can include the `src` as prefix (e.g. \"models/facebook/bart-base\")\n\n\n\nsrc\n\nstr | None\n\ndefault: None\n\n\t\n\nClass Method - the source of the model: `models` or `spaces` (or leave empty if source is provided as a prefix in `name`)\n\n\n\napi_key\n\nstr | None\n\ndefault: None\n\n\t\n\nClass Method - optional access token for loading private Hugging Face Hub models or spaces. Find your token here: https://huggingface.co/settings/tokens\n\n\n\nalias\n\nstr | None\n\ndefault: None\n\n\t\n\nClass Method - optional string used as the name of the loaded model instead of the default name (only applies if loading a Space running Gradio 2.x)\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Blocks\n\nBlock Layouts \n\nCustomize the layout of your Blocks UI with the layout classes below.\n\nRow\nwith gradio.Row():\n\nRow is a layout element within Blocks that renders all children horizontally.\n\n\n\nExample Usage\nwith gradio.Blocks() as demo:\n with gradio.Row():\n gr.Image(\"lion.jpg\")\n gr.Image(\"tiger.jpg\")\ndemo.launch()\nParameter\tDescription\n\nvariant\n\nstr\n\ndefault: \"default\"\n\n\t\n\nrow type, 'default' (no background), 'panel' (gray background color and rounded corners), or 'compact' (rounded corners and no internal gap).\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, row will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Row\n\nColumn\nwith gradio.Column():\n\nColumn is a layout element within Blocks that renders all children vertically. The widths of columns can be set through the `scale` and `min_width` parameters. If a certain scale results in a column narrower than min_width, the min_width parameter will win.\n\n\n\nExample Usage\nwith gradio.Blocks() as demo:\n with gradio.Row():\n with gradio.Column(scale=1):\n text1 = gr.Textbox()\n text2 = gr.Textbox()\n with gradio.Column(scale=4):\n btn1 = gr.Button(\"Button 1\")\n btn2 = gr.Button(\"Button 2\")\nParameter\tDescription\n\nscale\n\nint\n\ndefault: 1\n\n\t\n\nrelative width compared to adjacent Columns. For example, if Column A has scale=2, and Column B has scale=1, A will be twice as wide as B.\n\n\n\nmin_width\n\nint\n\ndefault: 320\n\n\t\n\nminimum pixel width of Column, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in a column narrower than min_width, the min_width parameter will be respected first.\n\n\n\nvariant\n\nstr\n\ndefault: \"default\"\n\n\t\n\ncolumn type, 'default' (no background), 'panel' (gray background color and rounded corners), or 'compact' (rounded corners and no internal gap).\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, column will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Column\n\nTab\nwith gradio.Tab():\n\nTab (or its alias TabItem) is a layout element. Components defined within the Tab will be visible when this tab is selected tab.\n\n\n\nExample Usage\nwith gradio.Blocks() as demo:\n with gradio.Tab(\"Lion\"):\n gr.Image(\"lion.jpg\")\n gr.Button(\"New Lion\")\n with gradio.Tab(\"Tiger\"):\n gr.Image(\"tiger.jpg\")\n gr.Button(\"New Tiger\")\nParameter\tDescription\n\nlabel\n\nstr\n\nrequired\n\n\t\n\nThe visual label for the tab\n\n\n\nid\n\nint | str | None\n\ndefault: None\n\n\t\n\nAn optional identifier for the tab, required if you wish to control the selected tab from a predict function.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nMethods\nselect\ngradio.Tab.select(fn, ···)\n\nThis event is triggered when the user selects from within the Component. This event has EventData of type gradio.SelectData that carries information, accessible through SelectData.index and SelectData.value. See EventData documentation on how to use this event data.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Tab\n\nBox\nwith gradio.Box():\n\nBox is a a layout element which places children in a box with rounded corners and some padding around them.\n\n\n\nExample Usage\nwith gradio.Box():\n gr.Textbox(label=\"First\")\n gr.Textbox(label=\"Last\")\nParameter\tDescription\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, box will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Box\n\nAccordion\ngradio.Accordion(label, ···)\n\nAccordion is a layout element which can be toggled to show/hide the contained content.\n\n\n\nExample Usage\nwith gradio.Accordion(\"See Details\"):\n gr.Markdown(\"lorem ipsum\")\nParameter\tDescription\n\nlabel\n\nrequired\n\n\t\n\nname of accordion section.\n\n\n\nopen\n\nbool\n\ndefault: True\n\n\t\n\nif True, accordion is open by default.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Accordion\n\nComponents \n\nGradio includes pre-built components that can be used as inputs or outputs in your Interface or Blocks with a single line of code. Components include preprocessing steps that convert user data submitted through browser to something that be can used by a Python function, and postprocessing steps to convert values returned by a Python function into something that can be displayed in a browser.\n\nConsider an example with three inputs (Textbox, Number, and Image) and two outputs (Number and Gallery), below is a diagram of what our preprocessing will send to the function and what our postprocessing will require from it.\n\nComponents also come with certain events that they support. These are methods that are triggered with user actions. Below is a table showing which events are supported for each component. All events are also listed (with parameters) in the component's docs.\n\n\tChange\tClick\tSubmit\tEdit\tClear\tPlay\tPause\tStream\tBlur\tUpload\nAudio\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nBarPlot\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nButton\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nChatbot\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nCheckbox\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nCheckboxGroup\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nCode\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nColorPicker\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nDataframe\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nDataset\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nDropdown\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nFile\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nGallery\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nHTML\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nHighlightedText\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nImage\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nInterpretation\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nJSON\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nLabel\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nLinePlot\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nMarkdown\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nModel3D\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nNumber\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nPlot\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nRadio\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nScatterPlot\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nSlider\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nState\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nTextbox\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nTimeseries\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nUploadButton\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\nVideo\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\n\t\n\n✕\n\nAudio\nTry Examples\ngradio.Audio(···)\n\nLoading...\n\ngradio/audio_component\nbuilt with Gradio.\nHosted on Spaces\n\nCreates an audio component that can be used to upload/record audio (as an input) or display audio (as an output).\n\n\n\n\nAs input: passes the uploaded audio as a Tuple(int, numpy.array) corresponding to (sample rate, data) or as a str filepath, depending on `type`\n\nAs output: expects a Tuple(int, numpy.array) corresponding to (sample rate, data) or as a str filepath or URL to an audio file, which gets displayed\n\nFormat expected for examples: a str filepath to a local file that contains audio.\n\nfrom math import log2, pow\nimport os\n\nimport numpy as np\nfrom scipy.fftpack import fft\n\nimport gradio as gr\n\nA4 = 440\nC0 = A4 * pow(2, -4.75)\nname = [\"C\", \"C#\", \"D\", \"D#\", \"E\", \"F\", \"F#\", \"G\", \"G#\", \"A\", \"A#\", \"B\"]\n\n\ndef get_pitch(freq):\n h = round(12 * log2(freq / C0))\n n = h % 12\n return name[n]\n\n\ndef main_note(audio):\n rate, y = audio\n if len(y.shape) == 2:\n y = y.T[0]\n N = len(y)\n T = 1.0 / rate\n x = np.linspace(0.0, N * T, N)\n yf = fft(y)\n yf2 = 2.0 / N * np.abs(yf[0 : N // 2])\n xf = np.linspace(0.0, 1.0 / (2.0 * T), N // 2)\n\n volume_per_pitch = {}\n total_volume = np.sum(yf2)\n for freq, volume in zip(xf, yf2):\n if freq == 0:\n continue\n pitch = get_pitch(freq)\n if pitch not in volume_per_pitch:\n volume_per_pitch[pitch] = 0\n volume_per_pitch[pitch] += 1.0 * volume / total_volume\n volume_per_pitch = {k: float(v) for k, v in volume_per_pitch.items()}\n return volume_per_pitch\n\n\ndemo = gr.Interface(\n main_note,\n gr.Audio(source=\"microphone\"),\n gr.Label(num_top_classes=4),\n examples=[\n [os.path.join(os.path.dirname(__file__),\"audio/recording1.wav\")],\n [os.path.join(os.path.dirname(__file__),\"audio/cantina.wav\")],\n ],\n interpretation=\"default\",\n)\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nstr | Tuple[int, np.ndarray] | Callable | None\n\ndefault: None\n\n\t\n\nA path, URL, or [sample_rate, numpy array] tuple for the default value that Audio component is going to take. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nsource\n\nstr\n\ndefault: \"upload\"\n\n\t\n\nSource of audio. \"upload\" creates a box where user can drop an audio file, \"microphone\" creates a microphone input.\n\n\n\ntype\n\nstr\n\ndefault: \"numpy\"\n\n\t\n\nThe format the audio file is converted to before being passed into the prediction function. \"numpy\" converts the audio to a tuple consisting of: (int sample rate, numpy.array for the data), \"filepath\" passes a str path to a temporary file containing the audio.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\ninteractive\n\nbool | None\n\ndefault: None\n\n\t\n\nif True, will allow users to upload and edit a audio file; if False, can only be used to play audio. If not provided, this is inferred based on whether the component is used as an input or output.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nstreaming\n\nbool\n\ndefault: False\n\n\t\n\nIf set to True when used in a `live` interface, will automatically stream webcam feed. Only valid is source is 'microphone'.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Audio\n\n\t\n\n\"audio\"\n\n\tUses default values\n\n\ngradio.Microphone\n\n\t\n\n\"microphone\"\n\n\tUses source=\"microphone\"\nMethods\nstyle\ngradio.Audio.style(···)\n\nThis method can be used to change the appearance of the audio component.\n\n\n\nchange\ngradio.Audio.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nclear\ngradio.Audio.clear(fn, ···)\n\nThis event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nplay\ngradio.Audio.play(fn, ···)\n\nThis event is triggered when the user plays the component (e.g. audio or video). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\npause\ngradio.Audio.pause(fn, ···)\n\nThis event is triggered when the user pauses the component (e.g. audio or video). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nstop\ngradio.Audio.stop(fn, ···)\n\nThis event is triggered when the user stops the component (e.g. audio or video). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nstream\ngradio.Audio.stream(fn, ···)\n\nThis event is triggered when the user streams the component (e.g. a live webcam component). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nupload\ngradio.Audio.upload(fn, ···)\n\nThis event is triggered when the user uploads a file into the component (e.g. when the user uploads a video into a video component). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Audio\n\nBarPlot\nTry Examples\ngradio.BarPlot(···)\n\nLoading...\n\ngradio/barplot_component\nbuilt with Gradio.\nHosted on Spaces\n\nCreate a bar plot.\n\n\n\n\n\n\nAs input: this component does *not* accept input.\n\nAs output: expects a pandas dataframe with the data to plot.\n\nimport gradio as gr\n\nfrom scatter_plot_demo import scatter_plot\nfrom line_plot_demo import line_plot\nfrom bar_plot_demo import bar_plot\n\n\nwith gr.Blocks() as demo:\n with gr.Tabs():\n with gr.TabItem(\"Scatter Plot\"):\n scatter_plot.render()\n with gr.TabItem(\"Line Plot\"):\n line_plot.render()\n with gr.TabItem(\"Bar Plot\"):\n bar_plot.render()\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\npd.DataFrame | Callable | None\n\ndefault: None\n\n\t\n\nThe pandas dataframe containing the data to display in a scatter plot.\n\n\n\nx\n\nstr | None\n\ndefault: None\n\n\t\n\nColumn corresponding to the x axis.\n\n\n\ny\n\nstr | None\n\ndefault: None\n\n\t\n\nColumn corresponding to the y axis.\n\n\n\ncolor\n\nstr | None\n\ndefault: None\n\n\t\n\nThe column to determine the bar color. Must be categorical (discrete values).\n\n\n\nvertical\n\nbool\n\ndefault: True\n\n\t\n\nIf True, the bars will be displayed vertically. If False, the x and y axis will be switched, displaying the bars horizontally. Default is True.\n\n\n\ngroup\n\nstr | None\n\ndefault: None\n\n\t\n\nThe column with which to split the overall plot into smaller subplots.\n\n\n\ntitle\n\nstr | None\n\ndefault: None\n\n\t\n\nThe title to display on top of the chart.\n\n\n\ntooltip\n\nList[str] | str | None\n\ndefault: None\n\n\t\n\nThe column (or list of columns) to display on the tooltip when a user hovers over a bar.\n\n\n\nx_title\n\nstr | None\n\ndefault: None\n\n\t\n\nThe title given to the x axis. By default, uses the value of the x parameter.\n\n\n\ny_title\n\nstr | None\n\ndefault: None\n\n\t\n\nThe title given to the y axis. By default, uses the value of the y parameter.\n\n\n\ncolor_legend_title\n\nstr | None\n\ndefault: None\n\n\t\n\nThe title given to the color legend. By default, uses the value of color parameter.\n\n\n\ngroup_title\n\nstr | None\n\ndefault: None\n\n\t\n\nThe label displayed on top of the subplot columns (or rows if vertical=True). Use an empty string to omit.\n\n\n\ncolor_legend_position\n\nstr | None\n\ndefault: None\n\n\t\n\nThe position of the color legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation.\n\n\n\nheight\n\nint | None\n\ndefault: None\n\n\t\n\nThe height of the plot in pixels.\n\n\n\nwidth\n\nint | None\n\ndefault: None\n\n\t\n\nThe width of the plot in pixels.\n\n\n\ny_lim\n\nList[int] | None\n\ndefault: None\n\n\t\n\nA tuple of list containing the limits for the y-axis, specified as [y_min, y_max].\n\n\n\ncaption\n\nstr | None\n\ndefault: None\n\n\t\n\nThe (optional) caption to display below the plot.\n\n\n\ninteractive\n\nbool | None\n\ndefault: True\n\n\t\n\nWhether users should be able to interact with the plot by panning or zooming with their mouse or trackpad.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\nThe (optional) label to display on the top left corner of the plot.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nWhether the label should be displayed.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nWhether the plot should be visible.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nUnique id used for custom css targetting.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.BarPlot\n\n\t\n\n\"barplot\"\n\n\tUses default values\nMethods\nchange\ngradio.BarPlot.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nclear\ngradio.BarPlot.clear(fn, ···)\n\nThis event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about BarPlot\n\nButton\nTry Examples\ngradio.Button(···)\n\nLoading...\n\ngradio/button_component\nbuilt with Gradio.\nHosted on Spaces\n\nUsed to create a button, that can be assigned arbitrary click() events. The label (value) of the button can be used as an input or set via the output of a function.\n\n\n\n\n\nAs input: passes the button value as a str into the function\n\nAs output: expects a str to be returned from a function, which is set as the label of the button\n\nimport gradio as gr\nimport os\n\n\ndef combine(a, b):\n return a + \" \" + b\n\n\ndef mirror(x):\n return x\n\n\nwith gr.Blocks() as demo:\n\n txt = gr.Textbox(label=\"Input\", lines=2)\n txt_2 = gr.Textbox(label=\"Input 2\")\n txt_3 = gr.Textbox(value=\"\", label=\"Output\")\n btn = gr.Button(value=\"Submit\")\n btn.click(combine, inputs=[txt, txt_2], outputs=[txt_3])\n\n with gr.Row():\n im = gr.Image()\n im_2 = gr.Image()\n\n btn = gr.Button(value=\"Mirror Image\")\n btn.click(mirror, inputs=[im], outputs=[im_2])\n\n gr.Markdown(\"## Text Examples\")\n gr.Examples(\n [[\"hi\", \"Adam\"], [\"hello\", \"Eve\"]],\n [txt, txt_2],\n txt_3,\n combine,\n cache_examples=True,\n )\n gr.Markdown(\"## Image Examples\")\n gr.Examples(\n examples=[os.path.join(os.path.dirname(__file__), \"lion.jpg\")],\n inputs=im,\n outputs=im_2,\n fn=mirror,\n cache_examples=True,\n )\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nstr | Callable\n\ndefault: \"Run\"\n\n\t\n\nDefault text for the button to display. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nvariant\n\nstr\n\ndefault: \"secondary\"\n\n\t\n\n'primary' for main call-to-action, 'secondary' for a more subdued style, 'stop' for a stop button.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\ninteractive\n\nbool\n\ndefault: True\n\n\t\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Button\n\n\t\n\n\"button\"\n\n\tUses default values\nMethods\nstyle\ngradio.Button.style(···)\n\nThis method can be used to change the appearance of the button component.\n\n\n\nParameter\tDescription\n\nfull_width\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will expand to fill parent container.\n\n\n\nsize\n\nLiteral['sm'] | Literal['lg'] | None\n\ndefault: None\n\n\t\n\nSize of the button. Can be \"sm\" or \"lg\".\n\nclick\ngradio.Button.click(fn, ···)\n\nThis event is triggered when the component (e.g. a button) is clicked. This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Button\n\nChatbot\nTry Examples\ngradio.Chatbot(···)\n\nLoading...\n\ngradio/chatbot_component\nbuilt with Gradio.\nHosted on Spaces\n\nDisplays a chatbot output showing both user submitted messages and responses. Supports a subset of Markdown including bold, italics, code, and images.\n\n\n\n\n\nAs input: this component does *not* accept input.\n\nAs output: expects function to return a List[Tuple[str | None | Tuple, str | None | Tuple]], a list of tuples with user message and response messages. Messages should be strings, tuples, or Nones. If the message is a string, it can include Markdown. If it is a tuple, it should consist of (string filepath to image/video/audio, [optional string alt text]). Messages that are `None` are not displayed.\n\nimport gradio as gr\nimport random\nimport time\n\nwith gr.Blocks() as demo:\n chatbot = gr.Chatbot()\n msg = gr.Textbox()\n clear = gr.Button(\"Clear\")\n\n def user(user_message, history):\n return \"\", history + [[user_message, None]]\n\n def bot(history):\n bot_message = random.choice([\"Yes\", \"No\"])\n history[-1][1] = bot_message\n time.sleep(1)\n return history\n\n msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(\n bot, chatbot, chatbot\n )\n clear.click(lambda: None, None, chatbot, queue=False)\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nList[Tuple[str | None, str | None]] | Callable | None\n\ndefault: None\n\n\t\n\nDefault value to show in chatbot. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\ncolor_map\n\nDict[str, str] | None\n\ndefault: None\n\n\t\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Chatbot\n\n\t\n\n\"chatbot\"\n\n\tUses default values\nMethods\nstyle\ngradio.Chatbot.style(···)\n\nThis method can be used to change the appearance of the Chatbot component.\n\n\n\nParameter\tDescription\n\nheight\n\nint | None\n\ndefault: None\n\n\t\n\nchange\ngradio.Chatbot.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nselect\ngradio.Chatbot.select(fn, ···)\n\nEvent listener for when the user selects message from Chatbot. Uses event data gradio.SelectData to carry `value` referring to text of selected message, and `index` tuple to refer to [message, participant] index. See EventData documentation on how to use this event data.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Chatbot\n\nCheckbox\nTry Examples\ngradio.Checkbox(···)\n\nLoading...\n\ngradio/checkbox_component\nbuilt with Gradio.\nHosted on Spaces\n\nCreates a checkbox that can be set to `True` or `False`.\n\n\n\n\n\nAs input: passes the status of the checkbox as a bool into the function.\n\nAs output: expects a bool returned from the function and, if it is True, checks the checkbox.\n\nFormat expected for examples: a bool representing whether the box is checked.\n\nimport gradio as gr\n\n\ndef sentence_builder(quantity, animal, countries, place, activity_list, morning):\n return f\"\"\"The {quantity} {animal}s from {\" and \".join(countries)} went to the {place} where they {\" and \".join(activity_list)} until the {\"morning\" if morning else \"night\"}\"\"\"\n\n\ndemo = gr.Interface(\n sentence_builder,\n [\n gr.Slider(2, 20, value=4, label=\"Count\", info=\"Choose betwen 2 and 20\"),\n gr.Dropdown(\n [\"cat\", \"dog\", \"bird\"], label=\"Animal\", info=\"Will add more animals later!\"\n ),\n gr.CheckboxGroup([\"USA\", \"Japan\", \"Pakistan\"], label=\"Countries\", info=\"Where are they from?\"),\n gr.Radio([\"park\", \"zoo\", \"road\"], label=\"Location\", info=\"Where did they go?\"),\n gr.Dropdown(\n [\"ran\", \"swam\", \"ate\", \"slept\"], value=[\"swam\", \"slept\"], multiselect=True, label=\"Activity\", info=\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed auctor, nisl eget ultricies aliquam, nunc nisl aliquet nunc, eget aliquam nisl nunc vel nisl.\"\n ),\n gr.Checkbox(label=\"Morning\", info=\"Did they do it in the morning?\"),\n ],\n \"text\",\n examples=[\n [2, \"cat\", \"park\", [\"ran\", \"swam\"], True],\n [4, \"dog\", \"zoo\", [\"ate\", \"swam\"], False],\n [10, \"bird\", \"road\", [\"ran\"], False],\n [8, \"cat\", \"zoo\", [\"ate\"], True],\n ],\n)\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nbool | Callable\n\ndefault: False\n\n\t\n\nif True, checked by default. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\ninfo\n\nstr | None\n\ndefault: None\n\n\t\n\nadditional component description.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\ninteractive\n\nbool | None\n\ndefault: None\n\n\t\n\nif True, this checkbox can be checked; if False, checking will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Checkbox\n\n\t\n\n\"checkbox\"\n\n\tUses default values\nMethods\nstyle\ngradio.Checkbox.style(···)\n\nThis method can be used to change the appearance of the component.\n\n\n\nParameter\tDescription\n\ncontainer\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the component in a container - providing some extra padding around the border.\n\nchange\ngradio.Checkbox.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nselect\ngradio.Checkbox.select(fn, ···)\n\nEvent listener for when the user selects or deselects Checkbox. Uses event data gradio.SelectData to carry `value` referring to label of checkbox, and `selected` to refer to state of checkbox. See EventData documentation on how to use this event data.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Checkbox\n\nCheckboxGroup\nTry Examples\ngradio.CheckboxGroup(···)\n\nLoading...\n\ngradio/checkboxgroup_component\nbuilt with Gradio.\nHosted on Spaces\n\nCreates a set of checkboxes of which a subset can be checked.\n\n\n\n\nAs input: passes the list of checked checkboxes as a List[str] or their indices as a List[int] into the function, depending on `type`.\n\nAs output: expects a List[str], each element of which becomes a checked checkbox.\n\nFormat expected for examples: a List[str] representing the values to be checked.\n\nimport gradio as gr\n\n\ndef sentence_builder(quantity, animal, countries, place, activity_list, morning):\n return f\"\"\"The {quantity} {animal}s from {\" and \".join(countries)} went to the {place} where they {\" and \".join(activity_list)} until the {\"morning\" if morning else \"night\"}\"\"\"\n\n\ndemo = gr.Interface(\n sentence_builder,\n [\n gr.Slider(2, 20, value=4, label=\"Count\", info=\"Choose betwen 2 and 20\"),\n gr.Dropdown(\n [\"cat\", \"dog\", \"bird\"], label=\"Animal\", info=\"Will add more animals later!\"\n ),\n gr.CheckboxGroup([\"USA\", \"Japan\", \"Pakistan\"], label=\"Countries\", info=\"Where are they from?\"),\n gr.Radio([\"park\", \"zoo\", \"road\"], label=\"Location\", info=\"Where did they go?\"),\n gr.Dropdown(\n [\"ran\", \"swam\", \"ate\", \"slept\"], value=[\"swam\", \"slept\"], multiselect=True, label=\"Activity\", info=\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed auctor, nisl eget ultricies aliquam, nunc nisl aliquet nunc, eget aliquam nisl nunc vel nisl.\"\n ),\n gr.Checkbox(label=\"Morning\", info=\"Did they do it in the morning?\"),\n ],\n \"text\",\n examples=[\n [2, \"cat\", \"park\", [\"ran\", \"swam\"], True],\n [4, \"dog\", \"zoo\", [\"ate\", \"swam\"], False],\n [10, \"bird\", \"road\", [\"ran\"], False],\n [8, \"cat\", \"zoo\", [\"ate\"], True],\n ],\n)\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nchoices\n\nList[str] | None\n\ndefault: None\n\n\t\n\nlist of options to select from.\n\n\n\nvalue\n\nList[str] | str | Callable | None\n\ndefault: None\n\n\t\n\ndefault selected list of options. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\ntype\n\nstr\n\ndefault: \"value\"\n\n\t\n\nType of value to be returned by component. \"value\" returns the list of strings of the choices selected, \"index\" returns the list of indicies of the choices selected.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\ninfo\n\nstr | None\n\ndefault: None\n\n\t\n\nadditional component description.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\ninteractive\n\nbool | None\n\ndefault: None\n\n\t\n\nif True, choices in this checkbox group will be checkable; if False, checking will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.CheckboxGroup\n\n\t\n\n\"checkboxgroup\"\n\n\tUses default values\nMethods\nstyle\ngradio.CheckboxGroup.style(···)\n\nThis method can be used to change the appearance of the CheckboxGroup.\n\n\n\nParameter\tDescription\n\nitem_container\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the items in a container.\n\n\n\ncontainer\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the component in a container - providing some extra padding around the border.\n\nchange\ngradio.CheckboxGroup.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nselect\ngradio.CheckboxGroup.select(fn, ···)\n\nEvent listener for when the user selects or deselects within CheckboxGroup. Uses event data gradio.SelectData to carry `value` referring to label of selected checkbox, `index` to refer to index, and `selected` to refer to state of checkbox. See EventData documentation on how to use this event data.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about CheckboxGroup\n\nCode\ngradio.Code(···)\n\nLoading...\n\ngradio/code_component\nbuilt with Gradio.\nHosted on Spaces\n\nCreates a Code editor for entering, editing or viewing code.\n\n\n\n\nAs input: passes a str of code into the function.\n\nAs output: expects the function to return a str of code or a single-elment tuple: (string filepath,)\n\nParameter\tDescription\n\nvalue\n\nstr | None\n\ndefault: None\n\n\t\n\nDefault value to show in the code editor. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nlanguage\n\nstr | None\n\ndefault: None\n\n\t\n\nThe language to display the code as. Supported languages listed in `gr.Code.languages`.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\ninteractive\n\nbool | None\n\ndefault: None\n\n\t\n\nWhether user should be able to enter code or only view it.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Code\n\n\t\n\n\"code\"\n\n\tUses default values\nMethods\nlanguages\ngr.Code.languages\n\n['python', 'markdown', 'json', 'html', 'css', 'javascript', 'typescript', 'yaml', 'dockerfile', 'shell', 'r', None]\n\n\n\nchange\ngradio.Code.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Code\n\nColorPicker\nTry Examples\ngradio.ColorPicker(···)\n\nLoading...\n\ngradio/colorpicker_component\nbuilt with Gradio.\nHosted on Spaces\n\nCreates a color picker for user to select a color as string input.\n\n\n\n\nAs input: passes selected color value as a str into the function.\n\nAs output: expects a str returned from function and sets color picker value to it.\n\nFormat expected for examples: a str with a hexadecimal representation of a color, e.g. \"#ff0000\" for red.\n\nimport gradio as gr\nimport numpy as np\nimport os\nfrom PIL import Image, ImageColor\n\n\ndef change_color(icon, color):\n\n \"\"\"\n Function that given an icon in .png format changes its color\n Args:\n icon: Icon whose color needs to be changed.\n color: Chosen color with which to edit the input icon.\n Returns:\n edited_image: Edited icon.\n \"\"\"\n img = icon.convert(\"LA\")\n img = img.convert(\"RGBA\")\n image_np = np.array(icon)\n _, _, _, alpha = image_np.T\n mask = alpha > 0\n image_np[..., :-1][mask.T] = ImageColor.getcolor(color, \"RGB\")\n edited_image = Image.fromarray(image_np)\n return edited_image\n\n\ninputs = [\n gr.Image(label=\"icon\", type=\"pil\", image_mode=\"RGBA\"),\n gr.ColorPicker(label=\"color\"),\n]\noutputs = gr.Image(label=\"colored icon\")\n\ndemo = gr.Interface(\n fn=change_color,\n inputs=inputs,\n outputs=outputs,\n examples=[\n [os.path.join(os.path.dirname(__file__), \"rabbit.png\"), \"#ff0000\"],\n [os.path.join(os.path.dirname(__file__), \"rabbit.png\"), \"#0000FF\"],\n ],\n)\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nstr | Callable | None\n\ndefault: None\n\n\t\n\ndefault text to provide in color picker. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\ninfo\n\nstr | None\n\ndefault: None\n\n\t\n\nadditional component description.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\ninteractive\n\nbool | None\n\ndefault: None\n\n\t\n\nif True, will be rendered as an editable color picker; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.ColorPicker\n\n\t\n\n\"colorpicker\"\n\n\tUses default values\nMethods\nstyle\ngradio.ColorPicker.style(···)\n\nThis method can be used to change the appearance of the component.\n\n\n\nParameter\tDescription\n\ncontainer\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the component in a container - providing some extra padding around the border.\n\nchange\ngradio.ColorPicker.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nsubmit\ngradio.ColorPicker.submit(fn, ···)\n\nThis event is triggered when the user presses the Enter key while the component (e.g. a textbox) is focused. This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about ColorPicker\n\nDataframe\nTry Examples\ngradio.Dataframe(···)\n\nLoading...\n\ngradio/dataframe_component\nbuilt with Gradio.\nHosted on Spaces\n\nAccepts or displays 2D input through a spreadsheet-like component for dataframes.\n\n\n\n\nAs input: passes the uploaded spreadsheet data as a pandas.DataFrame, numpy.array, List[List], or List depending on `type`\n\nAs output: expects a pandas.DataFrame, numpy.array, List[List], List, a Dict with keys `data` (and optionally `headers`), or str path to a csv, which is rendered in the spreadsheet.\n\nFormat expected for examples: a str filepath to a csv with data, a pandas dataframe, or a list of lists (excluding headers) where each sublist is a row of data.\n\nimport gradio as gr\n\n\ndef filter_records(records, gender):\n return records[records[\"gender\"] == gender]\n\n\ndemo = gr.Interface(\n filter_records,\n [\n gr.Dataframe(\n headers=[\"name\", \"age\", \"gender\"],\n datatype=[\"str\", \"number\", \"str\"],\n row_count=5,\n col_count=(3, \"fixed\"),\n ),\n gr.Dropdown([\"M\", \"F\", \"O\"]),\n ],\n \"dataframe\",\n description=\"Enter gender as 'M', 'F', or 'O' for other.\",\n)\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nList[List[Any]] | Callable | None\n\ndefault: None\n\n\t\n\nDefault value as a 2-dimensional list of values. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nheaders\n\nList[str] | None\n\ndefault: None\n\n\t\n\nList of str header names. If None, no headers are shown.\n\n\n\nrow_count\n\nint | Tuple[int, str]\n\ndefault: (1, 'dynamic')\n\n\t\n\nLimit number of rows for input and decide whether user can create new rows. The first element of the tuple is an `int`, the row count; the second should be 'fixed' or 'dynamic', the new row behaviour. If an `int` is passed the rows default to 'dynamic'\n\n\n\ncol_count\n\nint | Tuple[int, str] | None\n\ndefault: None\n\n\t\n\nLimit number of columns for input and decide whether user can create new columns. The first element of the tuple is an `int`, the number of columns; the second should be 'fixed' or 'dynamic', the new column behaviour. If an `int` is passed the columns default to 'dynamic'\n\n\n\ndatatype\n\nstr | List[str]\n\ndefault: \"str\"\n\n\t\n\nDatatype of values in sheet. Can be provided per column as a list of strings, or for the entire sheet as a single string. Valid datatypes are \"str\", \"number\", \"bool\", \"date\", and \"markdown\".\n\n\n\ntype\n\nstr\n\ndefault: \"pandas\"\n\n\t\n\nType of value to be returned by component. \"pandas\" for pandas dataframe, \"numpy\" for numpy array, or \"array\" for a Python array.\n\n\n\nmax_rows\n\nint | None\n\ndefault: 20\n\n\t\n\nMaximum number of rows to display at once. Set to None for infinite.\n\n\n\nmax_cols\n\nint | None\n\ndefault: None\n\n\t\n\nMaximum number of columns to display at once. Set to None for infinite.\n\n\n\noverflow_row_behaviour\n\nstr\n\ndefault: \"paginate\"\n\n\t\n\nIf set to \"paginate\", will create pages for overflow rows. If set to \"show_ends\", will show initial and final rows and truncate middle rows.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\ninteractive\n\nbool | None\n\ndefault: None\n\n\t\n\nif True, will allow users to edit the dataframe; if False, can only be used to display data. If not provided, this is inferred based on whether the component is used as an input or output.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\n\n\nwrap\n\nbool\n\ndefault: False\n\n\t\n\nif True text in table cells will wrap when appropriate, if False the table will scroll horiztonally. Defaults to False.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Dataframe\n\n\t\n\n\"dataframe\"\n\n\tUses default values\n\n\ngradio.Numpy\n\n\t\n\n\"numpy\"\n\n\tUses type=\"numpy\"\n\n\ngradio.Matrix\n\n\t\n\n\"matrix\"\n\n\tUses type=\"array\"\n\n\ngradio.List\n\n\t\n\n\"list\"\n\n\tUses type=\"array\", col_count=1\nMethods\nstyle\ngradio.Dataframe.style(···)\n\nThis method can be used to change the appearance of the DataFrame component.\n\n\n\nchange\ngradio.Dataframe.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nselect\ngradio.Dataframe.select(fn, ···)\n\nEvent listener for when the user selects cell within Dataframe. Uses event data gradio.SelectData to carry `value` referring to value of selected cell, and `index` tuple to refer to index row and column. See EventData documentation on how to use this event data.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Dataframe\n\nDataset\ngr.Dataset(components, samples)\n\nLoading...\n\ngradio/dataset_component\nbuilt with Gradio.\nHosted on Spaces\n\nUsed to create an output widget for showing datasets. Used to render the examples box.\n\n\n\n\nAs input: passes the selected sample either as a list of data (if type=\"value\") or as an int index (if type=\"index\")\n\nAs output: expects a list of lists corresponding to the dataset data.\n\nParameter\tDescription\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\n\n\ncomponents\n\nList[IOComponent] | List[str]\n\nrequired\n\n\t\n\nWhich component types to show in this dataset widget, can be passed in as a list of string names or Components instances. The following components are supported in a Dataset: Audio, Checkbox, CheckboxGroup, ColorPicker, Dataframe, Dropdown, File, HTML, Image, Markdown, Model3D, Number, Radio, Slider, Textbox, TimeSeries, Video\n\n\n\nsamples\n\nList[List[Any]] | None\n\ndefault: None\n\n\t\n\na nested list of samples. Each sublist within the outer list represents a data sample, and each element within the sublist represents an value for each component\n\n\n\nheaders\n\nList[str] | None\n\ndefault: None\n\n\t\n\nColumn headers in the Dataset widget, should be the same len as components. If not provided, inferred from component labels\n\n\n\ntype\n\nstr\n\ndefault: \"values\"\n\n\t\n\n'values' if clicking on a sample should pass the value of the sample, or \"index\" if it should pass the index of the sample\n\n\n\nsamples_per_page\n\nint\n\ndefault: 10\n\n\t\n\nhow many examples to show per page.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Dataset\n\n\t\n\n\"dataset\"\n\n\tUses default values\nMethods\nstyle\ngradio.Dataset.style(···)\n\nThis method can be used to change the appearance of the Dataset component.\n\n\n\nclick\ngradio.Dataset.click(fn, ···)\n\nThis event is triggered when the component (e.g. a button) is clicked. This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nselect\ngradio.Dataset.select(fn, ···)\n\nThis event is triggered when the user selects from within the Component. This event has EventData of type gradio.SelectData that carries information, accessible through SelectData.index and SelectData.value. See EventData documentation on how to use this event data.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Dataset\n\nDropdown\nTry Examples\ngradio.Dropdown(···)\n\nLoading...\n\ngradio/dropdown_component\nbuilt with Gradio.\nHosted on Spaces\n\nCreates a dropdown of choices from which entries can be selected.\n\n\n\n\nAs input: passes the value of the selected dropdown entry as a str or its index as an int into the function, depending on `type`.\n\nAs output: expects a str corresponding to the value of the dropdown entry to be selected.\n\nFormat expected for examples: a str representing the drop down value to select.\n\nimport gradio as gr\n\n\ndef sentence_builder(quantity, animal, countries, place, activity_list, morning):\n return f\"\"\"The {quantity} {animal}s from {\" and \".join(countries)} went to the {place} where they {\" and \".join(activity_list)} until the {\"morning\" if morning else \"night\"}\"\"\"\n\n\ndemo = gr.Interface(\n sentence_builder,\n [\n gr.Slider(2, 20, value=4, label=\"Count\", info=\"Choose betwen 2 and 20\"),\n gr.Dropdown(\n [\"cat\", \"dog\", \"bird\"], label=\"Animal\", info=\"Will add more animals later!\"\n ),\n gr.CheckboxGroup([\"USA\", \"Japan\", \"Pakistan\"], label=\"Countries\", info=\"Where are they from?\"),\n gr.Radio([\"park\", \"zoo\", \"road\"], label=\"Location\", info=\"Where did they go?\"),\n gr.Dropdown(\n [\"ran\", \"swam\", \"ate\", \"slept\"], value=[\"swam\", \"slept\"], multiselect=True, label=\"Activity\", info=\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed auctor, nisl eget ultricies aliquam, nunc nisl aliquet nunc, eget aliquam nisl nunc vel nisl.\"\n ),\n gr.Checkbox(label=\"Morning\", info=\"Did they do it in the morning?\"),\n ],\n \"text\",\n examples=[\n [2, \"cat\", \"park\", [\"ran\", \"swam\"], True],\n [4, \"dog\", \"zoo\", [\"ate\", \"swam\"], False],\n [10, \"bird\", \"road\", [\"ran\"], False],\n [8, \"cat\", \"zoo\", [\"ate\"], True],\n ],\n)\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nchoices\n\nstr | List[str] | None\n\ndefault: None\n\n\t\n\nlist of options to select from.\n\n\n\nvalue\n\nstr | List[str] | Callable | None\n\ndefault: None\n\n\t\n\ndefault value(s) selected in dropdown. If None, no value is selected by default. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\ntype\n\nstr\n\ndefault: \"value\"\n\n\t\n\nType of value to be returned by component. \"value\" returns the string of the choice selected, \"index\" returns the index of the choice selected.\n\n\n\nmultiselect\n\nbool | None\n\ndefault: None\n\n\t\n\nif True, multiple choices can be selected.\n\n\n\nmax_choices\n\nint | None\n\ndefault: None\n\n\t\n\nmaximum number of choices that can be selected. If None, no limit is enforced.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\ninfo\n\nstr | None\n\ndefault: None\n\n\t\n\nadditional component description.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\ninteractive\n\nbool | None\n\ndefault: None\n\n\t\n\nif True, choices in this dropdown will be selectable; if False, selection will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Dropdown\n\n\t\n\n\"dropdown\"\n\n\tUses default values\nMethods\nstyle\ngradio.Dropdown.style(···)\n\nThis method can be used to change the appearance of the Dropdown.\n\n\n\nParameter\tDescription\n\ncontainer\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the component in a container - providing some extra padding around the border.\n\nchange\ngradio.Dropdown.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nselect\ngradio.Dropdown.select(fn, ···)\n\nEvent listener for when the user selects Dropdown option. Uses event data gradio.SelectData to carry `value` referring to label of selected option, and `index` to refer to index. See EventData documentation on how to use this event data.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Dropdown\n\nFile\nTry Examples\ngradio.File(···)\n\nLoading...\n\ngradio/file_component\nbuilt with Gradio.\nHosted on Spaces\n\nCreates a file component that allows uploading generic file (when used as an input) and or displaying generic files (output).\n\n\n\n\nAs input: passes the uploaded file as a file-object or List[file-object] depending on `file_count` (or a bytes/Listbytes depending on `type`)\n\nAs output: expects function to return a str path to a file, or List[str] consisting of paths to files.\n\nFormat expected for examples: a str path to a local file that populates the component.\n\nfrom zipfile import ZipFile\n\nimport gradio as gr\n\n\ndef zip_to_json(file_obj):\n files = []\n with ZipFile(file_obj.name) as zfile:\n for zinfo in zfile.infolist():\n files.append(\n {\n \"name\": zinfo.filename,\n \"file_size\": zinfo.file_size,\n \"compressed_size\": zinfo.compress_size,\n }\n )\n return files\n\n\ndemo = gr.Interface(zip_to_json, \"file\", \"json\")\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nstr | List[str] | Callable | None\n\ndefault: None\n\n\t\n\nDefault file to display, given as str file path. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nfile_count\n\nstr\n\ndefault: \"single\"\n\n\t\n\nif single, allows user to upload one file. If \"multiple\", user uploads multiple files. If \"directory\", user uploads all files in selected directory. Return type will be list for each file in case of \"multiple\" or \"directory\".\n\n\n\nfile_types\n\nList[str] | None\n\ndefault: None\n\n\t\n\nList of file extensions or types of files to be uploaded (e.g. ['image', '.json', '.mp4']). \"file\" allows any file to be uploaded, \"image\" allows only image files to be uploaded, \"audio\" allows only audio files to be uploaded, \"video\" allows only video files to be uploaded, \"text\" allows only text files to be uploaded.\n\n\n\ntype\n\nstr\n\ndefault: \"file\"\n\n\t\n\nType of value to be returned by component. \"file\" returns a temporary file object with the same base name as the uploaded file, whose full path can be retrieved by file_obj.name, \"binary\" returns an bytes object.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\ninteractive\n\nbool | None\n\ndefault: None\n\n\t\n\nif True, will allow users to upload a file; if False, can only be used to display files. If not provided, this is inferred based on whether the component is used as an input or output.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.File\n\n\t\n\n\"file\"\n\n\tUses default values\n\n\ngradio.Files\n\n\t\n\n\"files\"\n\n\tUses file_count=\"multiple\"\nMethods\nstyle\ngradio.File.style(···)\n\nThis method can be used to change the appearance of the file component.\n\n\n\nchange\ngradio.File.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nclear\ngradio.File.clear(fn, ···)\n\nThis event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nupload\ngradio.File.upload(fn, ···)\n\nThis event is triggered when the user uploads a file into the component (e.g. when the user uploads a video into a video component). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nselect\ngradio.File.select(fn, ···)\n\nEvent listener for when the user selects file from list. Uses event data gradio.SelectData to carry `value` referring to name of selected file, and `index` to refer to index. See EventData documentation on how to use this event data.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about File\n\nGallery\nTry Examples\ngradio.Gallery(···)\n\nLoading...\n\ngradio/gallery_component\nbuilt with Gradio.\nHosted on Spaces\n\nUsed to display a list of images as a gallery that can be scrolled through.\n\n\n\n\n\nAs input: this component does *not* accept input.\n\nAs output: expects a list of images in any format, List[numpy.array | PIL.Image | str], or a List of (image, str caption) tuples and displays them.\n\n# This demo needs to be run from the repo folder.\n# python demo/fake_gan/run.py\nimport os\nimport random\n\nimport gradio as gr\n\n\ndef fake_gan():\n images = [\n (random.choice(\n [\n \"https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=387&q=80\",\n \"https://images.unsplash.com/photo-1554151228-14d9def656e4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=386&q=80\",\n \"https://images.unsplash.com/photo-1542909168-82c3e7fdca5c?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8aHVtYW4lMjBmYWNlfGVufDB8fDB8fA%3D%3D&w=1000&q=80\",\n \"https://images.unsplash.com/photo-1546456073-92b9f0a8d413?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=387&q=80\",\n \"https://images.unsplash.com/photo-1601412436009-d964bd02edbc?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=464&q=80\",\n ]\n ), f\"label {i}\" if i != 0 else \"label\" * 50)\n for i in range(3)\n ]\n return images\n\n\nwith gr.Blocks() as demo:\n with gr.Column(variant=\"panel\"):\n with gr.Row(variant=\"compact\"):\n text = gr.Textbox(\n label=\"Enter your prompt\",\n show_label=False,\n max_lines=1,\n placeholder=\"Enter your prompt\",\n ).style(\n container=False,\n )\n btn = gr.Button(\"Generate image\").style(full_width=False)\n\n gallery = gr.Gallery(\n label=\"Generated images\", show_label=False, elem_id=\"gallery\"\n ).style(grid=[2], height=\"auto\")\n\n btn.click(fake_gan, None, gallery)\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nList[np.ndarray | _Image.Image | str] | Callable | None\n\ndefault: None\n\n\t\n\nList of images to display in the gallery by default. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Gallery\n\n\t\n\n\"gallery\"\n\n\tUses default values\nMethods\nstyle\ngradio.Gallery.style(···)\n\nThis method can be used to change the appearance of the gallery component.\n\n\n\nParameter\tDescription\n\ngrid\n\nint | Tuple | None\n\ndefault: None\n\n\t\n\nRepresents the number of images that should be shown in one row, for each of the six standard screen sizes (<576px, <768px, <992px, <1200px, <1400px, >1400px). if fewer that 6 are given then the last will be used for all subsequent breakpoints\n\n\n\nheight\n\nstr | None\n\ndefault: None\n\n\t\n\nHeight of the gallery.\n\n\n\ncontainer\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place gallery in a container - providing some extra padding around the border.\n\n\n\npreview\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will display the Gallery in preview mode, which shows all of the images as thumbnails and allows the user to click on them to view them in full size.\n\nselect\ngradio.Gallery.select(fn, ···)\n\nEvent listener for when the user selects image within Gallery. Uses event data gradio.SelectData to carry `value` referring to caption of selected image, and `index` to refer to index. See EventData documentation on how to use this event data.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Gallery\n\nHTML\nTry Examples\ngradio.HTML(···)\n\nLoading...\n\ngradio/html_component\nbuilt with Gradio.\nHosted on Spaces\n\nUsed to display arbitrary HTML output.\n\n\n\n\n\nAs input: this component does *not* accept input.\n\nAs output: expects a valid HTML str.\n\nimport gradio as gr\nimport os\nos.system('python -m spacy download en_core_web_sm')\nimport spacy\nfrom spacy import displacy\n\nnlp = spacy.load(\"en_core_web_sm\")\n\ndef text_analysis(text):\n doc = nlp(text)\n html = displacy.render(doc, style=\"dep\", page=True)\n html = (\n \"\"\n + html\n + \"\"\n )\n pos_count = {\n \"char_count\": len(text),\n \"token_count\": 0,\n }\n pos_tokens = []\n\n for token in doc:\n pos_tokens.extend([(token.text, token.pos_), (\" \", None)])\n\n return pos_tokens, pos_count, html\n\ndemo = gr.Interface(\n text_analysis,\n gr.Textbox(placeholder=\"Enter sentence here...\"),\n [\"highlight\", \"json\", \"html\"],\n examples=[\n [\"What a beautiful morning for a walk!\"],\n [\"It was the best of times, it was the worst of times.\"],\n ],\n)\n\ndemo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nstr | Callable\n\ndefault: \"\"\n\n\t\n\nDefault value. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.HTML\n\n\t\n\n\"html\"\n\n\tUses default values\nMethods\nchange\ngradio.HTML.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about HTML\n\nHighlightedText\nTry Examples\ngradio.HighlightedText(···)\n\nLoading...\n\ngradio/highlightedtext_component\nbuilt with Gradio.\nHosted on Spaces\n\nDisplays text that contains spans that are highlighted by category or numerical value.\n\n\n\n\n\nAs input: this component does *not* accept input.\n\nAs output: expects a List[Tuple[str, float | str]]] consisting of spans of text and their associated labels, or a Dict with two keys: (1) \"text\" whose value is the complete text, and \"entities\", which is a list of dictionaries, each of which have the keys: \"entity\" (consisting of the entity label), \"start\" (the character index where the label starts), and \"end\" (the character index where the label ends). Entities should not overlap.\n\nfrom difflib import Differ\n\nimport gradio as gr\n\n\ndef diff_texts(text1, text2):\n d = Differ()\n return [\n (token[2:], token[0] if token[0] != \" \" else None)\n for token in d.compare(text1, text2)\n ]\n\n\ndemo = gr.Interface(\n diff_texts,\n [\n gr.Textbox(\n label=\"Text 1\",\n info=\"Initial text\",\n lines=3,\n value=\"The quick brown fox jumped over the lazy dogs.\",\n ),\n gr.Textbox(\n label=\"Text 2\",\n info=\"Text to compare\",\n lines=3,\n value=\"The fast brown fox jumps over lazy dogs.\",\n ),\n ],\n gr.HighlightedText(\n label=\"Diff\",\n combine_adjacent=True,\n ).style(color_map={\"+\": \"red\", \"-\": \"green\"}),\n theme=gr.themes.Base()\n)\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nList[Tuple[str, str | float | None]] | Dict | Callable | None\n\ndefault: None\n\n\t\n\nDefault value to show. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\ncolor_map\n\nDict[str, str] | None\n\ndefault: None\n\n\t\n\n\n\nshow_legend\n\nbool\n\ndefault: False\n\n\t\n\nwhether to show span categories in a separate legend or inline.\n\n\n\ncombine_adjacent\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will merge the labels of adjacent tokens belonging to the same category.\n\n\n\nadjacent_separator\n\nstr\n\ndefault: \"\"\n\n\t\n\nSpecifies the separator to be used between tokens if combine_adjacent is True.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.HighlightedText\n\n\t\n\n\"highlightedtext\"\n\n\tUses default values\nMethods\nstyle\ngradio.HighlightedText.style(···)\n\nThis method can be used to change the appearance of the HighlightedText component.\n\n\n\nParameter\tDescription\n\ncolor_map\n\nDict[str, str] | None\n\ndefault: None\n\n\t\n\nMap between category and respective colors.\n\n\n\ncontainer\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the component in a container - providing some extra padding around the border.\n\nchange\ngradio.HighlightedText.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nselect\ngradio.HighlightedText.select(fn, ···)\n\nEvent listener for when the user selects Highlighted text span. Uses event data gradio.SelectData to carry `value` referring to selected [text, label] tuple, and `index` to refer to span index. See EventData documentation on how to use this event data.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about HighlightedText\n\nImage\nTry Examples\ngradio.Image(···)\n\nLoading...\n\ngradio/image_component\nbuilt with Gradio.\nHosted on Spaces\n\nCreates an image component that can be used to upload/draw images (as an input) or display images (as an output).\n\n\n\n\nAs input: passes the uploaded image as a numpy.array, PIL.Image or str filepath depending on `type` -- unless `tool` is `sketch` AND source is one of `upload` or `webcam`. In these cases, a dict with keys `image` and `mask` is passed, and the format of the corresponding values depends on `type`.\n\nAs output: expects a numpy.array, PIL.Image or str or pathlib.Path filepath to an image and displays the image.\n\nFormat expected for examples: a str filepath to a local file that contains the image.\n\nimport gradio as gr\nimport os\n\n\ndef image_mod(image):\n return image.rotate(45)\n\n\ndemo = gr.Interface(\n image_mod,\n gr.Image(type=\"pil\"),\n \"image\",\n flagging_options=[\"blurry\", \"incorrect\", \"other\"],\n examples=[\n os.path.join(os.path.dirname(__file__), \"images/cheetah1.jpg\"),\n os.path.join(os.path.dirname(__file__), \"images/lion.jpg\"),\n os.path.join(os.path.dirname(__file__), \"images/logo.png\"),\n os.path.join(os.path.dirname(__file__), \"images/tower.jpg\"),\n ],\n)\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nstr | _Image.Image | np.ndarray | None\n\ndefault: None\n\n\t\n\nA PIL Image, numpy array, path or URL for the default value that Image component is going to take. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nshape\n\nTuple[int, int] | None\n\ndefault: None\n\n\t\n\n(width, height) shape to crop and resize image to; if None, matches input image size. Pass None for either width or height to only crop and resize the other.\n\n\n\nimage_mode\n\nstr\n\ndefault: \"RGB\"\n\n\t\n\n\"RGB\" if color, or \"L\" if black and white.\n\n\n\ninvert_colors\n\nbool\n\ndefault: False\n\n\t\n\nwhether to invert the image as a preprocessing step.\n\n\n\nsource\n\nstr\n\ndefault: \"upload\"\n\n\t\n\nSource of image. \"upload\" creates a box where user can drop an image file, \"webcam\" allows user to take snapshot from their webcam, \"canvas\" defaults to a white image that can be edited and drawn upon with tools.\n\n\n\ntool\n\nstr | None\n\ndefault: None\n\n\t\n\nTools used for editing. \"editor\" allows a full screen editor (and is the default if source is \"upload\" or \"webcam\"), \"select\" provides a cropping and zoom tool, \"sketch\" allows you to create a binary sketch (and is the default if source=\"canvas\"), and \"color-sketch\" allows you to created a sketch in different colors. \"color-sketch\" can be used with source=\"upload\" or \"webcam\" to allow sketching on an image. \"sketch\" can also be used with \"upload\" or \"webcam\" to create a mask over an image and in that case both the image and mask are passed into the function as a dictionary with keys \"image\" and \"mask\" respectively.\n\n\n\ntype\n\nstr\n\ndefault: \"numpy\"\n\n\t\n\nThe format the image is converted to before being passed into the prediction function. \"numpy\" converts the image to a numpy array with shape (width, height, 3) and values from 0 to 255, \"pil\" converts the image to a PIL image object, \"filepath\" passes a str path to a temporary file containing the image.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\ninteractive\n\nbool | None\n\ndefault: None\n\n\t\n\nif True, will allow users to upload and edit an image; if False, can only be used to display images. If not provided, this is inferred based on whether the component is used as an input or output.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nstreaming\n\nbool\n\ndefault: False\n\n\t\n\nIf True when used in a `live` interface, will automatically stream webcam feed. Only valid is source is 'webcam'.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\n\n\nmirror_webcam\n\nbool\n\ndefault: True\n\n\t\n\nIf True webcam will be mirrored. Default is True.\n\n\n\nbrush_radius\n\nint | None\n\ndefault: None\n\n\t\n\nSize of the brush for Sketch. Default is None which chooses a sensible default\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Image\n\n\t\n\n\"image\"\n\n\tUses default values\n\n\ngradio.Webcam\n\n\t\n\n\"webcam\"\n\n\tUses source=\"webcam\", interactive=True\n\n\ngradio.Sketchpad\n\n\t\n\n\"sketchpad\"\n\n\tUses image_mode=\"L\", source=\"canvas\", shape=(28, 28), invert_colors=True, interactive=True\n\n\ngradio.Paint\n\n\t\n\n\"paint\"\n\n\tUses source=\"canvas\", tool=\"color-sketch\", interactive=True\n\n\ngradio.ImageMask\n\n\t\n\n\"imagemask\"\n\n\tUses source=\"upload\", tool=\"sketch\", interactive=True\n\n\ngradio.ImagePaint\n\n\t\n\n\"imagepaint\"\n\n\tUses source=\"upload\", tool=\"color-sketch\", interactive=True\n\n\ngradio.Pil\n\n\t\n\n\"pil\"\n\n\tUses type=\"pil\"\nMethods\nstyle\ngradio.Image.style(···)\n\nThis method can be used to change the appearance of the Image component.\n\n\n\nParameter\tDescription\n\nheight\n\nint | None\n\ndefault: None\n\n\t\n\nHeight of the image.\n\n\n\nwidth\n\nint | None\n\ndefault: None\n\n\t\n\nWidth of the image.\n\nchange\ngradio.Image.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nedit\ngradio.Image.edit(fn, ···)\n\nThis event is triggered when the user edits the component (e.g. image) using the built-in editor. This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nclear\ngradio.Image.clear(fn, ···)\n\nThis event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nstream\ngradio.Image.stream(fn, ···)\n\nThis event is triggered when the user streams the component (e.g. a live webcam component). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nupload\ngradio.Image.upload(fn, ···)\n\nThis event is triggered when the user uploads a file into the component (e.g. when the user uploads a video into a video component). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Image\n\nInterpretation\ngradio.Interpretation(component, ···)\n\nLoading...\n\ngradio/interpretation_component\nbuilt with Gradio.\nHosted on Spaces\n\nUsed to create an interpretation widget for a component.\n\n\n\n\n\nAs input: this component does *not* accept input.\n\nAs output: expects a dict with keys \"original\" and \"interpretation\".\n\nParameter\tDescription\n\ncomponent\n\nComponent\n\nrequired\n\n\t\n\nWhich component to show in the interpretation widget.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nWhether or not the interpretation is visible.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Interpretation\n\n\t\n\n\"interpretation\"\n\n\tUses default values\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Interpretation\n\nJSON\nTry Examples\ngradio.JSON(···)\n\nLoading...\n\ngradio/json_component\nbuilt with Gradio.\nHosted on Spaces\n\nUsed to display arbitrary JSON output prettily.\n\n\n\n\n\nAs input: this component does *not* accept input.\n\nAs output: expects a str filepath to a file containing valid JSON -- or a list or dict that is valid JSON\n\nfrom zipfile import ZipFile\n\nimport gradio as gr\n\n\ndef zip_to_json(file_obj):\n files = []\n with ZipFile(file_obj.name) as zfile:\n for zinfo in zfile.infolist():\n files.append(\n {\n \"name\": zinfo.filename,\n \"file_size\": zinfo.file_size,\n \"compressed_size\": zinfo.compress_size,\n }\n )\n return files\n\n\ndemo = gr.Interface(zip_to_json, \"file\", \"json\")\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nstr | Callable | None\n\ndefault: None\n\n\t\n\nDefault value. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.JSON\n\n\t\n\n\"json\"\n\n\tUses default values\nMethods\nstyle\ngradio.JSON.style(···)\n\nThis method can be used to change the appearance of the JSON component.\n\n\n\nParameter\tDescription\n\ncontainer\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the JSON in a container - providing some extra padding around the border.\n\nchange\ngradio.JSON.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about JSON\n\nLabel\nTry Examples\ngradio.Label(···)\n\nLoading...\n\ngradio/label_component\nbuilt with Gradio.\nHosted on Spaces\n\nDisplays a classification label, along with confidence scores of top categories, if provided.\n\n\n\n\n\nAs input: this component does *not* accept input.\n\nAs output: expects a Dict[str, float] of classes and confidences, or str with just the class or an int/float for regression outputs, or a str path to a .json file containing a json dictionary in the structure produced by Label.postprocess().\n\nfrom math import log2, pow\nimport os\n\nimport numpy as np\nfrom scipy.fftpack import fft\n\nimport gradio as gr\n\nA4 = 440\nC0 = A4 * pow(2, -4.75)\nname = [\"C\", \"C#\", \"D\", \"D#\", \"E\", \"F\", \"F#\", \"G\", \"G#\", \"A\", \"A#\", \"B\"]\n\n\ndef get_pitch(freq):\n h = round(12 * log2(freq / C0))\n n = h % 12\n return name[n]\n\n\ndef main_note(audio):\n rate, y = audio\n if len(y.shape) == 2:\n y = y.T[0]\n N = len(y)\n T = 1.0 / rate\n x = np.linspace(0.0, N * T, N)\n yf = fft(y)\n yf2 = 2.0 / N * np.abs(yf[0 : N // 2])\n xf = np.linspace(0.0, 1.0 / (2.0 * T), N // 2)\n\n volume_per_pitch = {}\n total_volume = np.sum(yf2)\n for freq, volume in zip(xf, yf2):\n if freq == 0:\n continue\n pitch = get_pitch(freq)\n if pitch not in volume_per_pitch:\n volume_per_pitch[pitch] = 0\n volume_per_pitch[pitch] += 1.0 * volume / total_volume\n volume_per_pitch = {k: float(v) for k, v in volume_per_pitch.items()}\n return volume_per_pitch\n\n\ndemo = gr.Interface(\n main_note,\n gr.Audio(source=\"microphone\"),\n gr.Label(num_top_classes=4),\n examples=[\n [os.path.join(os.path.dirname(__file__),\"audio/recording1.wav\")],\n [os.path.join(os.path.dirname(__file__),\"audio/cantina.wav\")],\n ],\n interpretation=\"default\",\n)\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nDict[str, float] | str | float | Callable | None\n\ndefault: None\n\n\t\n\nDefault value to show in the component. If a str or number is provided, simply displays the string or number. If a {Dict[str, float]} of classes and confidences is provided, displays the top class on top and the `num_top_classes` below, along with their confidence bars. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nnum_top_classes\n\nint | None\n\ndefault: None\n\n\t\n\nnumber of most confident classes to show.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\n\n\ncolor\n\nstr | None\n\ndefault: None\n\n\t\n\nThe background color of the label (either a valid css color name or hexadecimal string).\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Label\n\n\t\n\n\"label\"\n\n\tUses default values\nMethods\nstyle\ngradio.Label.style(···)\n\nThis method can be used to change the appearance of the label component.\n\n\n\nParameter\tDescription\n\ncontainer\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will add a container to the label - providing some extra padding around the border.\n\nchange\ngradio.Label.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nselect\ngradio.Label.select(fn, ···)\n\nEvent listener for when the user selects a category from Label. Uses event data gradio.SelectData to carry `value` referring to name of selected category, and `index` to refer to index. See EventData documentation on how to use this event data.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Label\n\nLinePlot\nTry Examples\ngradio.LinePlot(···)\n\nLoading...\n\ngradio/lineplot_component\nbuilt with Gradio.\nHosted on Spaces\n\nCreate a line plot.\n\n\n\n\n\n\nAs input: this component does *not* accept input.\n\nAs output: expects a pandas dataframe with the data to plot.\n\nimport gradio as gr\n\nfrom scatter_plot_demo import scatter_plot\nfrom line_plot_demo import line_plot\nfrom bar_plot_demo import bar_plot\n\n\nwith gr.Blocks() as demo:\n with gr.Tabs():\n with gr.TabItem(\"Scatter Plot\"):\n scatter_plot.render()\n with gr.TabItem(\"Line Plot\"):\n line_plot.render()\n with gr.TabItem(\"Bar Plot\"):\n bar_plot.render()\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\npd.DataFrame | Callable | None\n\ndefault: None\n\n\t\n\nThe pandas dataframe containing the data to display in a scatter plot.\n\n\n\nx\n\nstr | None\n\ndefault: None\n\n\t\n\nColumn corresponding to the x axis.\n\n\n\ny\n\nstr | None\n\ndefault: None\n\n\t\n\nColumn corresponding to the y axis.\n\n\n\ncolor\n\nstr | None\n\ndefault: None\n\n\t\n\nThe column to determine the point color. If the column contains numeric data, gradio will interpolate the column data so that small values correspond to light colors and large values correspond to dark values.\n\n\n\nstroke_dash\n\nstr | None\n\ndefault: None\n\n\t\n\nThe column to determine the symbol used to draw the line, e.g. dashed lines, dashed lines with points.\n\n\n\noverlay_point\n\nbool | None\n\ndefault: None\n\n\t\n\nWhether to draw a point on the line for each (x, y) coordinate pair.\n\n\n\ntitle\n\nstr | None\n\ndefault: None\n\n\t\n\nThe title to display on top of the chart.\n\n\n\ntooltip\n\nList[str] | str | None\n\ndefault: None\n\n\t\n\nThe column (or list of columns) to display on the tooltip when a user hovers a point on the plot.\n\n\n\nx_title\n\nstr | None\n\ndefault: None\n\n\t\n\nThe title given to the x axis. By default, uses the value of the x parameter.\n\n\n\ny_title\n\nstr | None\n\ndefault: None\n\n\t\n\nThe title given to the y axis. By default, uses the value of the y parameter.\n\n\n\ncolor_legend_title\n\nstr | None\n\ndefault: None\n\n\t\n\nThe title given to the color legend. By default, uses the value of color parameter.\n\n\n\nstroke_dash_legend_title\n\nstr | None\n\ndefault: None\n\n\t\n\nThe title given to the stroke_dash legend. By default, uses the value of the stroke_dash parameter.\n\n\n\ncolor_legend_position\n\nstr | None\n\ndefault: None\n\n\t\n\nThe position of the color legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation.\n\n\n\nstroke_dash_legend_position\n\nstr | None\n\ndefault: None\n\n\t\n\nThe position of the stoke_dash legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation.\n\n\n\nheight\n\nint | None\n\ndefault: None\n\n\t\n\nThe height of the plot in pixels.\n\n\n\nwidth\n\nint | None\n\ndefault: None\n\n\t\n\nThe width of the plot in pixels.\n\n\n\nx_lim\n\nList[int] | None\n\ndefault: None\n\n\t\n\nA tuple or list containing the limits for the x-axis, specified as [x_min, x_max].\n\n\n\ny_lim\n\nList[int] | None\n\ndefault: None\n\n\t\n\nA tuple of list containing the limits for the y-axis, specified as [y_min, y_max].\n\n\n\ncaption\n\nstr | None\n\ndefault: None\n\n\t\n\nThe (optional) caption to display below the plot.\n\n\n\ninteractive\n\nbool | None\n\ndefault: True\n\n\t\n\nWhether users should be able to interact with the plot by panning or zooming with their mouse or trackpad.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\nThe (optional) label to display on the top left corner of the plot.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nWhether the label should be displayed.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nWhether the plot should be visible.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nUnique id used for custom css targetting.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.LinePlot\n\n\t\n\n\"lineplot\"\n\n\tUses default values\nMethods\nchange\ngradio.LinePlot.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nclear\ngradio.LinePlot.clear(fn, ···)\n\nThis event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about LinePlot\n\nMarkdown\nTry Examples\ngradio.Markdown(···)\n\nLoading...\n\ngradio/markdown_component\nbuilt with Gradio.\nHosted on Spaces\n\nUsed to render arbitrary Markdown output. Can also render latex enclosed by dollar signs.\n\n\n\n\n\nAs input: this component does *not* accept input.\n\nAs output: expects a valid str that can be rendered as Markdown.\n\nimport gradio as gr\n\ndef welcome(name):\n return f\"Welcome to Gradio, {name}!\"\n\nwith gr.Blocks() as demo:\n gr.Markdown(\n \"\"\"\n # Hello World!\n Start typing below to see the output.\n \"\"\")\n inp = gr.Textbox(placeholder=\"What is your name?\")\n out = gr.Textbox()\n inp.change(welcome, inp, out)\n\nif __name__ == \"__main__\":\n demo.launch()\nTry Examples\nParameter\tDescription\n\nvalue\n\nstr | Callable\n\ndefault: \"\"\n\n\t\n\nValue to show in Markdown component. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Markdown\n\n\t\n\n\"markdown\"\n\n\tUses default values\nMethods\nchange\ngradio.Markdown.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Markdown\n\nModel3D\nTry Examples\ngradio.Model3D(···)\n\nLoading...\n\ngradio/model3d_component\nbuilt with Gradio.\nHosted on Spaces\n\nComponent allows users to upload or view 3D Model files (.obj, .glb, or .gltf).\n\n\n\n\n\nAs input: This component passes the uploaded file as a str filepath.\n\nAs output: expects function to return a str path to a file of type (.obj, glb, or .gltf)\n\nimport gradio as gr\nimport os\n\n\ndef load_mesh(mesh_file_name):\n return mesh_file_name\n\n\ndemo = gr.Interface(\n fn=load_mesh,\n inputs=gr.Model3D(),\n outputs=gr.Model3D(\n clear_color=[0.0, 0.0, 0.0, 0.0], label=\"3D Model\"),\n examples=[\n [os.path.join(os.path.dirname(__file__), \"files/Bunny.obj\")],\n [os.path.join(os.path.dirname(__file__), \"files/Duck.glb\")],\n [os.path.join(os.path.dirname(__file__), \"files/Fox.gltf\")],\n [os.path.join(os.path.dirname(__file__), \"files/face.obj\")],\n ],\n)\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nstr | Callable | None\n\ndefault: None\n\n\t\n\npath to (.obj, glb, or .gltf) file to show in model3D viewer. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nclear_color\n\nList[float] | None\n\ndefault: None\n\n\t\n\nbackground color of scene\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Model3D\n\n\t\n\n\"model3d\"\n\n\tUses default values\nMethods\nstyle\ngradio.Model3D.style(···)\n\nThis method can be used to change the appearance of the Model3D component.\n\n\n\nchange\ngradio.Model3D.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nedit\ngradio.Model3D.edit(fn, ···)\n\nThis event is triggered when the user edits the component (e.g. image) using the built-in editor. This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nclear\ngradio.Model3D.clear(fn, ···)\n\nThis event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Model3D\n\nNumber\nTry Examples\ngradio.Number(···)\n\nLoading...\n\ngradio/number_component\nbuilt with Gradio.\nHosted on Spaces\n\nCreates a numeric field for user to enter numbers as input or display numeric output.\n\n\n\n\n\nAs input: passes field value as a float or int into the function, depending on `precision`.\n\nAs output: expects an int or float returned from the function and sets field value to it.\n\nFormat expected for examples: a float or int representing the number's value.\n\nimport gradio as gr\n\ndef tax_calculator(income, marital_status, assets):\n tax_brackets = [(10, 0), (25, 8), (60, 12), (120, 20), (250, 30)]\n total_deductible = sum(assets[\"Cost\"])\n taxable_income = income - total_deductible\n\n total_tax = 0\n for bracket, rate in tax_brackets:\n if taxable_income > bracket:\n total_tax += (taxable_income - bracket) * rate / 100\n\n if marital_status == \"Married\":\n total_tax *= 0.75\n elif marital_status == \"Divorced\":\n total_tax *= 0.8\n\n return round(total_tax)\n\ndemo = gr.Interface(\n tax_calculator,\n [\n \"number\",\n gr.Radio([\"Single\", \"Married\", \"Divorced\"]),\n gr.Dataframe(\n headers=[\"Item\", \"Cost\"],\n datatype=[\"str\", \"number\"],\n label=\"Assets Purchased this Year\",\n ),\n ],\n \"number\",\n examples=[\n [10000, \"Married\", [[\"Suit\", 5000], [\"Laptop\", 800], [\"Car\", 1800]]],\n [80000, \"Single\", [[\"Suit\", 800], [\"Watch\", 1800], [\"Car\", 800]]],\n ],\n)\n\ndemo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nfloat | Callable | None\n\ndefault: None\n\n\t\n\ndefault value. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\ninfo\n\nstr | None\n\ndefault: None\n\n\t\n\nadditional component description.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\ninteractive\n\nbool | None\n\ndefault: None\n\n\t\n\nif True, will be editable; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\n\n\nprecision\n\nint | None\n\ndefault: None\n\n\t\n\nPrecision to round input/output to. If set to 0, will round to nearest integer and convert type to int. If None, no rounding happens.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Number\n\n\t\n\n\"number\"\n\n\tUses default values\nMethods\nstyle\ngradio.Number.style(···)\n\nThis method can be used to change the appearance of the component.\n\n\n\nParameter\tDescription\n\ncontainer\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the component in a container - providing some extra padding around the border.\n\nchange\ngradio.Number.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nsubmit\ngradio.Number.submit(fn, ···)\n\nThis event is triggered when the user presses the Enter key while the component (e.g. a textbox) is focused. This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nblur\ngradio.Number.blur(fn, ···)\n\nThis event is triggered when the component's is unfocused/blurred (e.g. when the user clicks outside of a textbox). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Number\n\nPlot\nTry Examples\ngradio.Plot(···)\n\nLoading...\n\ngradio/plot_component\nbuilt with Gradio.\nHosted on Spaces\n\nUsed to display various kinds of plots (matplotlib, plotly, or bokeh are supported)\n\n\n\n\n\nAs input: this component does *not* accept input.\n\nAs output: expects either a matplotlib.figure.Figure, a plotly.graph_objects._figure.Figure, or a dict corresponding to a bokeh plot (json_item format)\n\nimport altair as alt\nimport gradio as gr\nimport numpy as np\nimport pandas as pd\nfrom vega_datasets import data\n\n\ndef make_plot(plot_type):\n if plot_type == \"scatter_plot\":\n cars = data.cars()\n return alt.Chart(cars).mark_point().encode(\n x='Horsepower',\n y='Miles_per_Gallon',\n color='Origin',\n )\n elif plot_type == \"heatmap\":\n # Compute x^2 + y^2 across a 2D grid\n x, y = np.meshgrid(range(-5, 5), range(-5, 5))\n z = x ** 2 + y ** 2\n\n # Convert this grid to columnar data expected by Altair\n source = pd.DataFrame({'x': x.ravel(),\n 'y': y.ravel(),\n 'z': z.ravel()})\n return alt.Chart(source).mark_rect().encode(\n x='x:O',\n y='y:O',\n color='z:Q'\n )\n elif plot_type == \"us_map\":\n states = alt.topo_feature(data.us_10m.url, 'states')\n source = data.income.url\n\n return alt.Chart(source).mark_geoshape().encode(\n shape='geo:G',\n color='pct:Q',\n tooltip=['name:N', 'pct:Q'],\n facet=alt.Facet('group:N', columns=2),\n ).transform_lookup(\n lookup='id',\n from_=alt.LookupData(data=states, key='id'),\n as_='geo'\n ).properties(\n width=300,\n height=175,\n ).project(\n type='albersUsa'\n )\n elif plot_type == \"interactive_barplot\":\n source = data.movies.url\n\n pts = alt.selection(type=\"single\", encodings=['x'])\n\n rect = alt.Chart(data.movies.url).mark_rect().encode(\n alt.X('IMDB_Rating:Q', bin=True),\n alt.Y('Rotten_Tomatoes_Rating:Q', bin=True),\n alt.Color('count()',\n scale=alt.Scale(scheme='greenblue'),\n legend=alt.Legend(title='Total Records')\n )\n )\n\n circ = rect.mark_point().encode(\n alt.ColorValue('grey'),\n alt.Size('count()',\n legend=alt.Legend(title='Records in Selection')\n )\n ).transform_filter(\n pts\n )\n\n bar = alt.Chart(source).mark_bar().encode(\n x='Major_Genre:N',\n y='count()',\n color=alt.condition(pts, alt.ColorValue(\"steelblue\"), alt.ColorValue(\"grey\"))\n ).properties(\n width=550,\n height=200\n ).add_selection(pts)\n\n plot = alt.vconcat(\n rect + circ,\n bar\n ).resolve_legend(\n color=\"independent\",\n size=\"independent\"\n )\n return plot\n elif plot_type == \"radial\":\n source = pd.DataFrame({\"values\": [12, 23, 47, 6, 52, 19]})\n\n base = alt.Chart(source).encode(\n theta=alt.Theta(\"values:Q\", stack=True),\n radius=alt.Radius(\"values\", scale=alt.Scale(type=\"sqrt\", zero=True, rangeMin=20)),\n color=\"values:N\",\n )\n\n c1 = base.mark_arc(innerRadius=20, stroke=\"#fff\")\n\n c2 = base.mark_text(radiusOffset=10).encode(text=\"values:Q\")\n\n return c1 + c2\n elif plot_type == \"multiline\":\n source = data.stocks()\n\n highlight = alt.selection(type='single', on='mouseover',\n fields=['symbol'], nearest=True)\n\n base = alt.Chart(source).encode(\n x='date:T',\n y='price:Q',\n color='symbol:N'\n )\n\n points = base.mark_circle().encode(\n opacity=alt.value(0)\n ).add_selection(\n highlight\n ).properties(\n width=600\n )\n\n lines = base.mark_line().encode(\n size=alt.condition(~highlight, alt.value(1), alt.value(3))\n )\n\n return points + lines\n\n\nwith gr.Blocks() as demo:\n button = gr.Radio(label=\"Plot type\",\n choices=['scatter_plot', 'heatmap', 'us_map',\n 'interactive_barplot', \"radial\", \"multiline\"], value='scatter_plot')\n plot = gr.Plot(label=\"Plot\")\n button.change(make_plot, inputs=button, outputs=[plot])\n demo.load(make_plot, inputs=[button], outputs=[plot])\n\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nCallable | None | pd.DataFrame\n\ndefault: None\n\n\t\n\nOptionally, supply a default plot object to display, must be a matplotlib, plotly, altair, or bokeh figure, or a callable. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Plot\n\n\t\n\n\"plot\"\n\n\tUses default values\nMethods\nchange\ngradio.Plot.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nclear\ngradio.Plot.clear(fn, ···)\n\nThis event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Plot\n\nRadio\nTry Examples\ngradio.Radio(···)\n\nLoading...\n\ngradio/radio_component\nbuilt with Gradio.\nHosted on Spaces\n\nCreates a set of radio buttons of which only one can be selected.\n\n\n\n\n\nAs input: passes the value of the selected radio button as a str or its index as an int into the function, depending on `type`.\n\nAs output: expects a str corresponding to the value of the radio button to be selected.\n\nFormat expected for examples: a str representing the radio option to select.\n\nimport gradio as gr\n\n\ndef sentence_builder(quantity, animal, countries, place, activity_list, morning):\n return f\"\"\"The {quantity} {animal}s from {\" and \".join(countries)} went to the {place} where they {\" and \".join(activity_list)} until the {\"morning\" if morning else \"night\"}\"\"\"\n\n\ndemo = gr.Interface(\n sentence_builder,\n [\n gr.Slider(2, 20, value=4, label=\"Count\", info=\"Choose betwen 2 and 20\"),\n gr.Dropdown(\n [\"cat\", \"dog\", \"bird\"], label=\"Animal\", info=\"Will add more animals later!\"\n ),\n gr.CheckboxGroup([\"USA\", \"Japan\", \"Pakistan\"], label=\"Countries\", info=\"Where are they from?\"),\n gr.Radio([\"park\", \"zoo\", \"road\"], label=\"Location\", info=\"Where did they go?\"),\n gr.Dropdown(\n [\"ran\", \"swam\", \"ate\", \"slept\"], value=[\"swam\", \"slept\"], multiselect=True, label=\"Activity\", info=\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed auctor, nisl eget ultricies aliquam, nunc nisl aliquet nunc, eget aliquam nisl nunc vel nisl.\"\n ),\n gr.Checkbox(label=\"Morning\", info=\"Did they do it in the morning?\"),\n ],\n \"text\",\n examples=[\n [2, \"cat\", \"park\", [\"ran\", \"swam\"], True],\n [4, \"dog\", \"zoo\", [\"ate\", \"swam\"], False],\n [10, \"bird\", \"road\", [\"ran\"], False],\n [8, \"cat\", \"zoo\", [\"ate\"], True],\n ],\n)\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nchoices\n\nList[str] | None\n\ndefault: None\n\n\t\n\nlist of options to select from.\n\n\n\nvalue\n\nstr | Callable | None\n\ndefault: None\n\n\t\n\nthe button selected by default. If None, no button is selected by default. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\ntype\n\nstr\n\ndefault: \"value\"\n\n\t\n\nType of value to be returned by component. \"value\" returns the string of the choice selected, \"index\" returns the index of the choice selected.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\ninfo\n\nstr | None\n\ndefault: None\n\n\t\n\nadditional component description.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\ninteractive\n\nbool | None\n\ndefault: None\n\n\t\n\nif True, choices in this radio group will be selectable; if False, selection will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Radio\n\n\t\n\n\"radio\"\n\n\tUses default values\nMethods\nstyle\ngradio.Radio.style(···)\n\nThis method can be used to change the appearance of the radio component.\n\n\n\nParameter\tDescription\n\nitem_container\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place items in a container.\n\n\n\ncontainer\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the component in a container - providing some extra padding around the border.\n\nchange\ngradio.Radio.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nselect\ngradio.Radio.select(fn, ···)\n\nEvent listener for when the user selects Radio option. Uses event data gradio.SelectData to carry `value` referring to label of selected option, and `index` to refer to index. See EventData documentation on how to use this event data.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Radio\n\nScatterPlot\nTry Examples\ngradio.ScatterPlot(···)\n\nLoading...\n\ngradio/scatterplot_component\nbuilt with Gradio.\nHosted on Spaces\n\nCreate a scatter plot.\n\n\n\n\n\n\nAs input: this component does *not* accept input.\n\nAs output: expects a pandas dataframe with the data to plot.\n\nimport gradio as gr\n\nfrom scatter_plot_demo import scatter_plot\nfrom line_plot_demo import line_plot\nfrom bar_plot_demo import bar_plot\n\n\nwith gr.Blocks() as demo:\n with gr.Tabs():\n with gr.TabItem(\"Scatter Plot\"):\n scatter_plot.render()\n with gr.TabItem(\"Line Plot\"):\n line_plot.render()\n with gr.TabItem(\"Bar Plot\"):\n bar_plot.render()\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\npd.DataFrame | Callable | None\n\ndefault: None\n\n\t\n\nThe pandas dataframe containing the data to display in a scatter plot, or a callable. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nx\n\nstr | None\n\ndefault: None\n\n\t\n\nColumn corresponding to the x axis.\n\n\n\ny\n\nstr | None\n\ndefault: None\n\n\t\n\nColumn corresponding to the y axis.\n\n\n\ncolor\n\nstr | None\n\ndefault: None\n\n\t\n\nThe column to determine the point color. If the column contains numeric data, gradio will interpolate the column data so that small values correspond to light colors and large values correspond to dark values.\n\n\n\nsize\n\nstr | None\n\ndefault: None\n\n\t\n\nThe column used to determine the point size. Should contain numeric data so that gradio can map the data to the point size.\n\n\n\nshape\n\nstr | None\n\ndefault: None\n\n\t\n\nThe column used to determine the point shape. Should contain categorical data. Gradio will map each unique value to a different shape.\n\n\n\ntitle\n\nstr | None\n\ndefault: None\n\n\t\n\nThe title to display on top of the chart.\n\n\n\ntooltip\n\nList[str] | str | None\n\ndefault: None\n\n\t\n\nThe column (or list of columns) to display on the tooltip when a user hovers a point on the plot.\n\n\n\nx_title\n\nstr | None\n\ndefault: None\n\n\t\n\nThe title given to the x axis. By default, uses the value of the x parameter.\n\n\n\ny_title\n\nstr | None\n\ndefault: None\n\n\t\n\nThe title given to the y axis. By default, uses the value of the y parameter.\n\n\n\ncolor_legend_title\n\nstr | None\n\ndefault: None\n\n\t\n\nThe title given to the color legend. By default, uses the value of color parameter.\n\n\n\nsize_legend_title\n\nstr | None\n\ndefault: None\n\n\t\n\nThe title given to the size legend. By default, uses the value of the size parameter.\n\n\n\nshape_legend_title\n\nstr | None\n\ndefault: None\n\n\t\n\nThe title given to the shape legend. By default, uses the value of the shape parameter.\n\n\n\ncolor_legend_position\n\nstr | None\n\ndefault: None\n\n\t\n\nThe position of the color legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation.\n\n\n\nsize_legend_position\n\nstr | None\n\ndefault: None\n\n\t\n\nThe position of the size legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation.\n\n\n\nshape_legend_position\n\nstr | None\n\ndefault: None\n\n\t\n\nThe position of the shape legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation.\n\n\n\nheight\n\nint | None\n\ndefault: None\n\n\t\n\nThe height of the plot in pixels.\n\n\n\nwidth\n\nint | None\n\ndefault: None\n\n\t\n\nThe width of the plot in pixels.\n\n\n\nx_lim\n\nList[int | float] | None\n\ndefault: None\n\n\t\n\nA tuple or list containing the limits for the x-axis, specified as [x_min, x_max].\n\n\n\ny_lim\n\nList[int | float] | None\n\ndefault: None\n\n\t\n\nA tuple of list containing the limits for the y-axis, specified as [y_min, y_max].\n\n\n\ncaption\n\nstr | None\n\ndefault: None\n\n\t\n\nThe (optional) caption to display below the plot.\n\n\n\ninteractive\n\nbool | None\n\ndefault: True\n\n\t\n\nWhether users should be able to interact with the plot by panning or zooming with their mouse or trackpad.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\nThe (optional) label to display on the top left corner of the plot.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nWhether the label should be displayed.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nWhether the plot should be visible.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nUnique id used for custom css targetting.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.ScatterPlot\n\n\t\n\n\"scatterplot\"\n\n\tUses default values\nMethods\nchange\ngradio.ScatterPlot.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nclear\ngradio.ScatterPlot.clear(fn, ···)\n\nThis event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about ScatterPlot\n\nSlider\nTry Examples\ngradio.Slider(···)\n\nLoading...\n\ngradio/slider_component\nbuilt with Gradio.\nHosted on Spaces\n\nCreates a slider that ranges from `minimum` to `maximum` with a step size of `step`.\n\n\n\n\n\nAs input: passes slider value as a float into the function.\n\nAs output: expects an int or float returned from function and sets slider value to it as long as it is within range.\n\nFormat expected for examples: A float or int representing the slider's value.\n\nimport gradio as gr\n\n\ndef sentence_builder(quantity, animal, countries, place, activity_list, morning):\n return f\"\"\"The {quantity} {animal}s from {\" and \".join(countries)} went to the {place} where they {\" and \".join(activity_list)} until the {\"morning\" if morning else \"night\"}\"\"\"\n\n\ndemo = gr.Interface(\n sentence_builder,\n [\n gr.Slider(2, 20, value=4, label=\"Count\", info=\"Choose betwen 2 and 20\"),\n gr.Dropdown(\n [\"cat\", \"dog\", \"bird\"], label=\"Animal\", info=\"Will add more animals later!\"\n ),\n gr.CheckboxGroup([\"USA\", \"Japan\", \"Pakistan\"], label=\"Countries\", info=\"Where are they from?\"),\n gr.Radio([\"park\", \"zoo\", \"road\"], label=\"Location\", info=\"Where did they go?\"),\n gr.Dropdown(\n [\"ran\", \"swam\", \"ate\", \"slept\"], value=[\"swam\", \"slept\"], multiselect=True, label=\"Activity\", info=\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed auctor, nisl eget ultricies aliquam, nunc nisl aliquet nunc, eget aliquam nisl nunc vel nisl.\"\n ),\n gr.Checkbox(label=\"Morning\", info=\"Did they do it in the morning?\"),\n ],\n \"text\",\n examples=[\n [2, \"cat\", \"park\", [\"ran\", \"swam\"], True],\n [4, \"dog\", \"zoo\", [\"ate\", \"swam\"], False],\n [10, \"bird\", \"road\", [\"ran\"], False],\n [8, \"cat\", \"zoo\", [\"ate\"], True],\n ],\n)\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nminimum\n\nfloat\n\ndefault: 0\n\n\t\n\nminimum value for slider.\n\n\n\nmaximum\n\nfloat\n\ndefault: 100\n\n\t\n\nmaximum value for slider.\n\n\n\nvalue\n\nfloat | Callable | None\n\ndefault: None\n\n\t\n\ndefault value. If callable, the function will be called whenever the app loads to set the initial value of the component. Ignored if randomized=True.\n\n\n\nstep\n\nfloat | None\n\ndefault: None\n\n\t\n\nincrement between slider values.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\ninfo\n\nstr | None\n\ndefault: None\n\n\t\n\nadditional component description.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\ninteractive\n\nbool | None\n\ndefault: None\n\n\t\n\nif True, slider will be adjustable; if False, adjusting will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\n\n\nrandomize\n\nbool\n\ndefault: False\n\n\t\n\nIf True, the value of the slider when the app loads is taken uniformly at random from the range given by the minimum and maximum.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Slider\n\n\t\n\n\"slider\"\n\n\tUses default values\nMethods\nstyle\ngradio.Slider.style(···)\n\nThis method can be used to change the appearance of the slider.\n\n\n\nParameter\tDescription\n\ncontainer\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the component in a container - providing some extra padding around the border.\n\nchange\ngradio.Slider.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nrelease\ngradio.Slider.release(fn, ···)\n\nThis event is triggered when the user releases the mouse on this component (e.g. when the user releases the slider). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Slider\n\nState\nTry Examples\ngradio.State(···)\n\nSpecial hidden component that stores session state across runs of the demo by the same user. The value of the State variable is cleared when the user refreshes the page.\n\n\n\n\n\nAs input: No preprocessing is performed\n\nAs output: No postprocessing is performed\n\nimport gradio as gr\n\ndemo = gr.Blocks(css=\"#btn {color: red}\")\n\nwith demo:\n default_json = {\"a\": \"a\"}\n\n num = gr.State(value=0)\n squared = gr.Number(value=0)\n btn = gr.Button(\"Next Square\", elem_id=\"btn\").style(rounded=False)\n\n stats = gr.State(value=default_json)\n table = gr.JSON()\n\n def increase(var, stats_history):\n var += 1\n stats_history[str(var)] = var**2\n return var, var**2, stats_history, stats_history\n\n btn.click(increase, [num, stats], [num, squared, stats, table])\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nAny\n\ndefault: None\n\n\t\n\nthe initial value of the state. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about State\n\nTextbox\nTry Examples\ngradio.Textbox(···)\n\nLoading...\n\ngradio/textbox_component\nbuilt with Gradio.\nHosted on Spaces\n\nCreates a textarea for user to enter string input or display string output.\n\n\n\n\n\nAs input: passes textarea value as a str into the function.\n\nAs output: expects a str returned from function and sets textarea value to it.\n\nFormat expected for examples: a str representing the textbox input.\n\nimport gradio as gr\n\ndef greet(name):\n return \"Hello \" + name + \"!\"\n\ndemo = gr.Interface(fn=greet, inputs=\"text\", outputs=\"text\")\n \nif __name__ == \"__main__\":\n demo.launch() \nTry Examples\nParameter\tDescription\n\nvalue\n\nstr | Callable | None\n\ndefault: \"\"\n\n\t\n\ndefault text to provide in textarea. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nlines\n\nint\n\ndefault: 1\n\n\t\n\nminimum number of line rows to provide in textarea.\n\n\n\nmax_lines\n\nint\n\ndefault: 20\n\n\t\n\nmaximum number of line rows to provide in textarea.\n\n\n\nplaceholder\n\nstr | None\n\ndefault: None\n\n\t\n\nplaceholder hint to provide behind textarea.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\ninfo\n\nstr | None\n\ndefault: None\n\n\t\n\nadditional component description.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\ninteractive\n\nbool | None\n\ndefault: None\n\n\t\n\nif True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\n\n\ntype\n\nstr\n\ndefault: \"text\"\n\n\t\n\nThe type of textbox. One of: 'text', 'password', 'email', Default is 'text'.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Textbox\n\n\t\n\n\"textbox\"\n\n\tUses default values\n\n\ngradio.TextArea\n\n\t\n\n\"textarea\"\n\n\tUses lines=7\nMethods\nstyle\ngradio.Textbox.style(···)\n\nThis method can be used to change the appearance of the component.\n\n\n\nParameter\tDescription\n\ncontainer\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the component in a container - providing some extra padding around the border.\n\nchange\ngradio.Textbox.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nsubmit\ngradio.Textbox.submit(fn, ···)\n\nThis event is triggered when the user presses the Enter key while the component (e.g. a textbox) is focused. This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nblur\ngradio.Textbox.blur(fn, ···)\n\nThis event is triggered when the component's is unfocused/blurred (e.g. when the user clicks outside of a textbox). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nselect\ngradio.Textbox.select(fn, ···)\n\nEvent listener for when the user selects text in the Textbox. Uses event data gradio.SelectData to carry `value` referring to selected subtring, and `index` tuple referring to selected range endpoints. See EventData documentation on how to use this event data.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Textbox\n\nTimeseries\nTry Examples\ngradio.Timeseries(···)\n\nLoading...\n\ngradio/timeseries_component\nbuilt with Gradio.\nHosted on Spaces\n\nCreates a component that can be used to upload/preview timeseries csv files or display a dataframe consisting of a time series graphically.\n\n\n\n\nAs input: passes the uploaded timeseries data as a pandas.DataFrame into the function\n\nAs output: expects a pandas.DataFrame or str path to a csv to be returned, which is then displayed as a timeseries graph\n\nFormat expected for examples: a str filepath of csv data with time series data.\n\nimport random\nimport os\nimport gradio as gr\n\n\ndef fraud_detector(card_activity, categories, sensitivity):\n activity_range = random.randint(0, 100)\n drop_columns = [\n column for column in [\"retail\", \"food\", \"other\"] if column not in categories\n ]\n if len(drop_columns):\n card_activity.drop(columns=drop_columns, inplace=True)\n return (\n card_activity,\n card_activity,\n {\"fraud\": activity_range / 100.0, \"not fraud\": 1 - activity_range / 100.0},\n )\n\n\ndemo = gr.Interface(\n fraud_detector,\n [\n gr.Timeseries(x=\"time\", y=[\"retail\", \"food\", \"other\"]),\n gr.CheckboxGroup(\n [\"retail\", \"food\", \"other\"], value=[\"retail\", \"food\", \"other\"]\n ),\n gr.Slider(1, 3),\n ],\n [\n \"dataframe\",\n gr.Timeseries(x=\"time\", y=[\"retail\", \"food\", \"other\"]),\n gr.Label(label=\"Fraud Level\"),\n ],\n examples=[\n [os.path.join(os.path.dirname(__file__), \"fraud.csv\"), [\"retail\", \"food\", \"other\"], 1.0],\n ],\n)\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nstr | Callable | None\n\ndefault: None\n\n\t\n\nFile path for the timeseries csv file. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nx\n\nstr | None\n\ndefault: None\n\n\t\n\nColumn name of x (time) series. None if csv has no headers, in which case first column is x series.\n\n\n\ny\n\nstr | List[str] | None\n\ndefault: None\n\n\t\n\nColumn name of y series, or list of column names if multiple series. None if csv has no headers, in which case every column after first is a y series.\n\n\n\ncolors\n\nList[str] | None\n\ndefault: None\n\n\t\n\nan ordered list of colors to use for each line plot\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\ninteractive\n\nbool | None\n\ndefault: None\n\n\t\n\nif True, will allow users to upload a timeseries csv; if False, can only be used to display timeseries data. If not provided, this is inferred based on whether the component is used as an input or output.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Timeseries\n\n\t\n\n\"timeseries\"\n\n\tUses default values\nMethods\nstyle\ngradio.Timeseries.style(···)\n\nThis method can be used to change the appearance of the TimeSeries component.\n\n\n\nchange\ngradio.Timeseries.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Timeseries\n\nUploadButton\nTry Examples\ngradio.UploadButton(···)\n\nLoading...\n\ngradio/uploadbutton_component\nbuilt with Gradio.\nHosted on Spaces\n\nUsed to create an upload button, when cicked allows a user to upload files that satisfy the specified file type or generic files (if file_type not set).\n\n\n\n\nAs input: passes the uploaded file as a file-object or List[file-object] depending on `file_count` (or a bytes/Listbytes depending on `type`)\n\nAs output: expects function to return a str path to a file, or List[str] consisting of paths to files.\n\nFormat expected for examples: a str path to a local file that populates the component.\n\nimport gradio as gr\n\ndef upload_file(files):\n file_paths = [file.name for file in files]\n return file_paths\n\nwith gr.Blocks() as demo:\n file_output = gr.File()\n upload_button = gr.UploadButton(\"Click to Upload a File\", file_types=[\"image\", \"video\"], file_count=\"multiple\")\n upload_button.upload(upload_file, upload_button, file_output)\n\ndemo.launch()\n\nTry Examples\nParameter\tDescription\n\nlabel\n\nstr\n\ndefault: \"Upload a File\"\n\n\t\n\nText to display on the button. Defaults to \"Upload a File\".\n\n\n\nvalue\n\nstr | List[str] | Callable | None\n\ndefault: None\n\n\t\n\nDefault text for the button to display.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\n\n\ntype\n\nstr\n\ndefault: \"file\"\n\n\t\n\nType of value to be returned by component. \"file\" returns a temporary file object with the same base name as the uploaded file, whose full path can be retrieved by file_obj.name, \"binary\" returns an bytes object.\n\n\n\nfile_count\n\nstr\n\ndefault: \"single\"\n\n\t\n\nif single, allows user to upload one file. If \"multiple\", user uploads multiple files. If \"directory\", user uploads all files in selected directory. Return type will be list for each file in case of \"multiple\" or \"directory\".\n\n\n\nfile_types\n\nList[str] | None\n\ndefault: None\n\n\t\n\nList of type of files to be uploaded. \"file\" allows any file to be uploaded, \"image\" allows only image files to be uploaded, \"audio\" allows only audio files to be uploaded, \"video\" allows only video files to be uploaded, \"text\" allows only text files to be uploaded.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.UploadButton\n\n\t\n\n\"uploadbutton\"\n\n\tUses default values\nMethods\nstyle\ngradio.UploadButton.style(···)\n\nThis method can be used to change the appearance of the button component.\n\n\n\nParameter\tDescription\n\nfull_width\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will expand to fill parent container.\n\n\n\nsize\n\nLiteral['sm'] | Literal['lg'] | None\n\ndefault: None\n\n\t\n\nSize of the button. Can be \"sm\" or \"lg\".\n\nclick\ngradio.UploadButton.click(fn, ···)\n\nThis event is triggered when the component (e.g. a button) is clicked. This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nupload\ngradio.UploadButton.upload(fn, ···)\n\nThis event is triggered when the user uploads a file into the component (e.g. when the user uploads a video into a video component). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about UploadButton\n\nVideo\nTry Examples\ngradio.Video(···)\n\nLoading...\n\ngradio/video_component\nbuilt with Gradio.\nHosted on Spaces\n\nCreates a video component that can be used to upload/record videos (as an input) or display videos (as an output). For the video to be playable in the browser it must have a compatible container and codec combination. Allowed combinations are .mp4 with h264 codec, .ogg with theora codec, and .webm with vp9 codec. If the component detects that the output video would not be playable in the browser it will attempt to convert it to a playable mp4 video. If the conversion fails, the original video is returned.\n\n\n\n\nAs input: passes the uploaded video as a str filepath or URL whose extension can be modified by `format`.\n\nAs output: expects a str filepath to a video which is displayed.\n\nFormat expected for examples: a str filepath to a local file that contains the video.\n\nimport gradio as gr\nimport os\n\n\ndef video_identity(video):\n return video\n\n\ndemo = gr.Interface(video_identity, \n gr.Video(), \n \"playable_video\", \n examples=[\n os.path.join(os.path.dirname(__file__), \n \"video/video_sample.mp4\")], \n cache_examples=True)\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nvalue\n\nstr | Callable | None\n\ndefault: None\n\n\t\n\nA path or URL for the default value that Video component is going to take. If callable, the function will be called whenever the app loads to set the initial value of the component.\n\n\n\nformat\n\nstr | None\n\ndefault: None\n\n\t\n\nFormat of video format to be returned by component, such as 'avi' or 'mp4'. Use 'mp4' to ensure browser playability. If set to None, video will keep uploaded format.\n\n\n\nsource\n\nstr\n\ndefault: \"upload\"\n\n\t\n\nSource of video. \"upload\" creates a box where user can drop an video file, \"webcam\" allows user to record a video from their webcam.\n\n\n\nlabel\n\nstr | None\n\ndefault: None\n\n\t\n\ncomponent name in interface.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nIf `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n\n\n\nshow_label\n\nbool\n\ndefault: True\n\n\t\n\nif True, will display label.\n\n\n\ninteractive\n\nbool | None\n\ndefault: None\n\n\t\n\nif True, will allow users to upload a video; if False, can only be used to display videos. If not provided, this is inferred based on whether the component is used as an input or output.\n\n\n\nvisible\n\nbool\n\ndefault: True\n\n\t\n\nIf False, component will be hidden.\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n\n\n\nmirror_webcam\n\nbool\n\ndefault: True\n\n\t\n\nIf True webcam will be mirrored. Default is True.\n\n\n\ninclude_audio\n\nbool | None\n\ndefault: None\n\n\t\n\nWhether the component should record/retain the audio track for a video. By default, audio is excluded for webcam videos and included for uploaded videos.\n\nClass\tInterface String Shortcut\tInitialization\n\n\ngradio.Video\n\n\t\n\n\"video\"\n\n\tUses default values\n\n\ngradio.PlayableVideo\n\n\t\n\n\"playablevideo\"\n\n\tUses format=\"mp4\"\nMethods\nstyle\ngradio.Video.style(···)\n\nThis method can be used to change the appearance of the video component.\n\n\n\nParameter\tDescription\n\nheight\n\nint | None\n\ndefault: None\n\n\t\n\nHeight of the video.\n\n\n\nwidth\n\nint | None\n\ndefault: None\n\n\t\n\nWidth of the video.\n\nchange\ngradio.Video.change(fn, ···)\n\nThis event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nclear\ngradio.Video.clear(fn, ···)\n\nThis event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nplay\ngradio.Video.play(fn, ···)\n\nThis event is triggered when the user plays the component (e.g. audio or video). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\npause\ngradio.Video.pause(fn, ···)\n\nThis event is triggered when the user pauses the component (e.g. audio or video). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nstop\ngradio.Video.stop(fn, ···)\n\nThis event is triggered when the user stops the component (e.g. audio or video). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nupload\ngradio.Video.upload(fn, ···)\n\nThis event is triggered when the user uploads a file into the component (e.g. when the user uploads a video into a video component). This method can be used when this component is in a Gradio Blocks.\n\n\n\nParameter\tDescription\n\nfn\n\nCallable | None\n\nrequired\n\n\t\n\nthe function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n\n\n\ninputs\n\nComponent | List[Component] | Set[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n\n\n\noutputs\n\nComponent | List[Component] | None\n\ndefault: None\n\n\t\n\nList of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n\n\n\napi_name\n\nstr | None\n\ndefault: None\n\n\t\n\nDefining this parameter exposes the endpoint in the api docs\n\n\n\nstatus_tracker\n\nStatusTracker | None\n\ndefault: None\n\n\t\n\n\n\nscroll_to_output\n\nbool\n\ndefault: False\n\n\t\n\nIf True, will scroll to output component on completion\n\n\n\nshow_progress\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will show progress animation while pending\n\n\n\nqueue\n\nbool | None\n\ndefault: None\n\n\t\n\nIf True, will place the request on the queue, if the queue exists\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n\n\n\nmax_batch_size\n\nint\n\ndefault: 4\n\n\t\n\nMaximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nIf False, will not run postprocessing of component data before returning 'fn' output to the browser.\n\n\n\ncancels\n\nDict[str, Any] | List[Dict[str, Any]] | None\n\ndefault: None\n\n\t\n\nA list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method.\n\n\n\nevery\n\nfloat | None\n\ndefault: None\n\n\t\n\nRun this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Video\n\nHelpers \n\nGradio includes helper classes and methods that interact with existing components. The goal of these classes and methods is to help you add common functionality to your app without having to rewrite common functions.\n\nExamples\nTry Examples\ngradio.Examples(examples, inputs, ···)\n\nLoading...\n\ngradio/examples_component\nbuilt with Gradio.\nHosted on Spaces\n\nThis class is a wrapper over the Dataset component and can be used to create Examples for Blocks / Interfaces. Populates the Dataset component with examples and assigns event listener so that clicking on an example populates the input/output components. Optionally handles example caching for fast inference.\n\n\n\n\nimport gradio as gr\nimport os\n\n\ndef combine(a, b):\n return a + \" \" + b\n\n\ndef mirror(x):\n return x\n\n\nwith gr.Blocks() as demo:\n\n txt = gr.Textbox(label=\"Input\", lines=2)\n txt_2 = gr.Textbox(label=\"Input 2\")\n txt_3 = gr.Textbox(value=\"\", label=\"Output\")\n btn = gr.Button(value=\"Submit\")\n btn.click(combine, inputs=[txt, txt_2], outputs=[txt_3])\n\n with gr.Row():\n im = gr.Image()\n im_2 = gr.Image()\n\n btn = gr.Button(value=\"Mirror Image\")\n btn.click(mirror, inputs=[im], outputs=[im_2])\n\n gr.Markdown(\"## Text Examples\")\n gr.Examples(\n [[\"hi\", \"Adam\"], [\"hello\", \"Eve\"]],\n [txt, txt_2],\n txt_3,\n combine,\n cache_examples=True,\n )\n gr.Markdown(\"## Image Examples\")\n gr.Examples(\n examples=[os.path.join(os.path.dirname(__file__), \"lion.jpg\")],\n inputs=im,\n outputs=im_2,\n fn=mirror,\n cache_examples=True,\n )\n\nif __name__ == \"__main__\":\n demo.launch()\n\nTry Examples\nParameter\tDescription\n\nexamples\n\nList[Any] | List[List[Any]] | str\n\nrequired\n\n\t\n\nexample inputs that can be clicked to populate specific components. Should be nested list, in which the outer list consists of samples and each inner list consists of an input corresponding to each input component. A string path to a directory of examples can also be provided but it should be within the directory with the python file running the gradio app. If there are multiple input components and a directory is provided, a log.csv file must be present in the directory to link corresponding inputs.\n\n\n\ninputs\n\nIOComponent | List[IOComponent]\n\nrequired\n\n\t\n\nthe component or list of components corresponding to the examples\n\n\n\noutputs\n\nIOComponent | List[IOComponent] | None\n\ndefault: None\n\n\t\n\noptionally, provide the component or list of components corresponding to the output of the examples. Required if `cache` is True.\n\n\n\nfn\n\nCallable | None\n\ndefault: None\n\n\t\n\noptionally, provide the function to run to generate the outputs corresponding to the examples. Required if `cache` is True.\n\n\n\ncache_examples\n\nbool\n\ndefault: False\n\n\t\n\nif True, caches examples for fast runtime. If True, then `fn` and `outputs` need to be provided\n\n\n\nexamples_per_page\n\nint\n\ndefault: 10\n\n\t\n\nhow many examples to show per page.\n\n\n\nlabel\n\nstr | None\n\ndefault: \"Examples\"\n\n\t\n\nthe label to use for the examples component (by default, \"Examples\")\n\n\n\nelem_id\n\nstr | None\n\ndefault: None\n\n\t\n\nan optional string that is assigned as the id of this component in the HTML DOM.\n\n\n\nrun_on_click\n\nbool\n\ndefault: False\n\n\t\n\nif cache_examples is False, clicking on an example does not run the function when an example is clicked. Set this to True to run the function when an example is clicked. Has no effect if cache_examples is True.\n\n\n\npreprocess\n\nbool\n\ndefault: True\n\n\t\n\nif True, preprocesses the example input before running the prediction function and caching the output. Only applies if cache_examples is True.\n\n\n\npostprocess\n\nbool\n\ndefault: True\n\n\t\n\nif True, postprocesses the example output after running the prediction function and before caching. Only applies if cache_examples is True.\n\n\n\nbatch\n\nbool\n\ndefault: False\n\n\t\n\nIf True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. Used only if cache_examples is True.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Examples\n\nProgress\nTry Examples\ngradio.Progress(···)\nError\n\nThis space is experiencing an issue.\n\nPlease contact the author of the space to let them know.\n\ngradio/progress_component\nbuilt with Gradio.\nHosted on Spaces\n\nThe Progress class provides a custom progress tracker that is used in a function signature. To attach a Progress tracker to a function, simply add a parameter right after the input parameters that has a default value set to a `gradio.Progress()` instance. The Progress tracker can then be updated in the function by calling the Progress object or using the `tqdm` method on an Iterable. The Progress tracker is currently only available with `queue()`.\n\n\n\nExample Usage\nimport gradio as gr\nimport time\ndef my_function(x, progress=gr.Progress()):\n progress(0, desc=\"Starting...\")\n time.sleep(1)\n for i in progress.tqdm(range(100)):\n time.sleep(0.1)\n return x\ngr.Interface(my_function, gr.Textbox(), gr.Textbox()).queue().launch()\nMore Examples →\nParameter\tDescription\n\ntrack_tqdm\n\nbool\n\ndefault: False\n\n\t\n\nIf True, the Progress object will track any tqdm.tqdm iterations with the tqdm library in the function.\n\nMethods\n__call__\ngradio.Progress(progress, ···)\n\nUpdates progress tracker with progress and message text.\n\n\n\nParameter\tDescription\n\nprogress\n\nfloat | Tuple[int, int | None] | None\n\nrequired\n\n\t\n\nIf float, should be between 0 and 1 representing completion. If Tuple, first number represents steps completed, and second value represents total steps or None if unknown. If None, hides progress bar.\n\n\n\ndesc\n\nstr | None\n\ndefault: None\n\n\t\n\ndescription to display.\n\n\n\ntotal\n\nint | None\n\ndefault: None\n\n\t\n\nestimated total number of steps.\n\n\n\nunit\n\nstr\n\ndefault: \"steps\"\n\n\t\n\nunit of iterations.\n\ntqdm\ngradio.Progress.tqdm(iterable, args, ···)\n\nAttaches progress tracker to iterable, like tqdm.\n\n\n\nParameter\tDescription\n\niterable\n\nIterable | None\n\nrequired\n\n\t\n\niterable to attach progress tracker to.\n\n\n\ndesc\n\nstr | None\n\ndefault: None\n\n\t\n\ndescription to display.\n\n\n\ntotal\n\nint | None\n\ndefault: None\n\n\t\n\nestimated total number of steps.\n\n\n\nunit\n\nstr\n\ndefault: \"steps\"\n\n\t\n\nunit of iterations.\n\n\n\nargs\n\nrequired\n\n\t\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about Progress\n\nupdate\nTry Examples\ngradio.update(kwargs, ···)\n\nUpdates component properties. When a function passed into a Gradio Interface or a Blocks events returns a typical value, it updates the value of the output component. But it is also possible to update the properties of an output component (such as the number of lines of a `Textbox` or the visibility of an `Image`) by returning the component's `update()` function, which takes as parameters any of the constructor parameters for that component. This is a shorthand for using the update method on a component. For example, rather than using gr.Number.update(...) you can just use gr.update(...). Note that your editor's autocompletion will suggest proper parameters if you use the update method on the component.\n\n\n\n\nExample Usage\n# Blocks Example\nimport gradio as gr\nwith gr.Blocks() as demo:\n radio = gr.Radio([1, 2, 4], label=\"Set the value of the number\")\n number = gr.Number(value=2, interactive=True)\n radio.change(fn=lambda value: gr.update(value=value), inputs=radio, outputs=number)\ndemo.launch()\n\n# Interface example\nimport gradio as gr\ndef change_textbox(choice):\n if choice == \"short\":\n return gr.Textbox.update(lines=2, visible=True)\n elif choice == \"long\":\n return gr.Textbox.update(lines=8, visible=True)\n else:\n return gr.Textbox.update(visible=False)\ngr.Interface(\n change_textbox,\n gr.Radio(\n [\"short\", \"long\", \"none\"], label=\"What kind of essay would you like to write?\"\n ),\n gr.Textbox(lines=2),\n live=True,\n).launch()\nMore Examples →\nParameter\tDescription\n\nkwargs\n\nrequired\n\n\t\n\nKey-word arguments used to update the component's properties.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about update\n\nmake_waveform\ngradio.make_waveform(audio, ···)\n\nGenerates a waveform video from an audio file. Useful for creating an easy to share audio visualization. The output should be passed into a `gr.Video` component.\n\n\n\nParameter\tDescription\n\naudio\n\nstr | Tuple[int, np.ndarray]\n\nrequired\n\n\t\n\nAudio file path or tuple of (sample_rate, audio_data)\n\n\n\nbg_color\n\nstr\n\ndefault: \"#f3f4f6\"\n\n\t\n\nBackground color of waveform (ignored if bg_image is provided)\n\n\n\nbg_image\n\nstr | None\n\ndefault: None\n\n\t\n\nBackground image of waveform\n\n\n\nfg_alpha\n\nfloat\n\ndefault: 0.75\n\n\t\n\nOpacity of foreground waveform\n\n\n\nbars_color\n\nstr | Tuple[str, str]\n\ndefault: ('#fbbf24', '#ea580c')\n\n\t\n\nColor of waveform bars. Can be a single color or a tuple of (start_color, end_color) of gradient\n\n\n\nbar_count\n\nint\n\ndefault: 50\n\n\t\n\nNumber of bars in waveform\n\n\n\nbar_width\n\nfloat\n\ndefault: 0.6\n\n\t\n\nWidth of bars in waveform. 1 represents full width, 0.5 represents half width, etc.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about make_waveform\n\nEventData\nTry Examples\ngradio.EventData(target, ···)\n\nWhen a subclass of EventData is added as a type hint to an argument of an event listener method, this object will be passed as that argument. It contains information about the event that triggered the listener, such the target object, and other data related to the specific event that are attributes of the subclass.\n\n\n\n\nExample Usage\ntable = gr.Dataframe([[1, 2, 3], [4, 5, 6]])\ngallery = gr.Gallery([(\"cat.jpg\", \"Cat\"), (\"dog.jpg\", \"Dog\")])\ntextbox = gr.Textbox(\"Hello World!\")\n\nstatement = gr.Textbox()\n\ndef on_select(evt: gr.SelectData): # SelectData is a subclass of EventData\n return f\"You selected {evt.value} at {evt.index} from {evt.target}\"\n\ntable.select(on_select, None, statement)\ngallery.select(on_select, None, statement)\ntextbox.select(on_select, None, statement)\nMore Examples →\nParameter\tDescription\n\ntarget\n\nBlock | None\n\nrequired\n\n\t\n\nThe target object that triggered the event. Can be used to distinguish if multiple components are bound to the same listener.\n\nStep-by-step Guides\n\nNo guides yet, contribute a guide about EventData\n\nRoutes \n\nGradio includes some helper functions for exposing and interacting with the FastAPI app used to run your demo.\n\nRequest\ngradio.Request(···)\n\nA Gradio request object that can be used to access the request headers, cookies, query parameters and other information about the request from within the prediction function. The class is a thin wrapper around the fastapi.Request class. Attributes of this class include: `headers`, `client`, `query_params`, and `path_params`. If auth is enabled, the `username` attribute can be used to get the logged in user.\n\n\n\nExample Usage\nimport gradio as gr\ndef echo(name, request: gr.Request):\n print(\"Request headers dictionary:\", request.headers)\n print(\"IP address:\", request.client.host)\n return name\nio = gr.Interface(echo, \"textbox\", \"textbox\").launch()\nParameter\tDescription\n\nrequest\n\nfastapi.Request | None\n\ndefault: None\n\n\t\n\nA fastapi.Request\n\n\n\nusername\n\nstr | None\n\ndefault: None\n\n\t\n\nmount_gradio_app\ngradio.mount_gradio_app(app, blocks, path, ···)\n\nMount a gradio.Blocks to an existing FastAPI application.\n\n\n\n\nExample Usage\nfrom fastapi import FastAPI\nimport gradio as gr\napp = FastAPI()\n@app.get(\"/\")\ndef read_main():\n return {\"message\": \"This is your main app\"}\nio = gr.Interface(lambda x: \"Hello, \" + x + \"!\", \"textbox\", \"textbox\")\napp = gr.mount_gradio_app(app, io, path=\"/gradio\")\n# Then run `uvicorn run:app` from the terminal and navigate to http://localhost:8000/gradio.\nParameter\tDescription\n\napp\n\nfastapi.FastAPI\n\nrequired\n\n\t\n\nThe parent FastAPI application.\n\n\n\nblocks\n\ngradio.Blocks\n\nrequired\n\n\t\n\nThe blocks object we want to mount to the parent app.\n\n\n\npath\n\nstr\n\nrequired\n\n\t\n\nThe path at which the gradio application will be mounted.\n\n\n\ngradio_api_url\n\nstr | None\n\ndefault: None\n\n\t\n\nThe full url at which the gradio app will run. This is only needed if deploying to Huggingface spaces of if the websocket endpoints of your deployed app are on a different network location than the gradio app. If deploying to spaces, set gradio_api_url to 'http://localhost:7860/'\n\n1 item selected\n\nVIEW RESULTS\ngradio"},{"gradio":"New to Gradio? Start here: Getting Started"},{"gradio":"See the Release History"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Interface is Gradio's main high-level class, and allows you to create a web-based GUI / demo around a machine learning model (or any Python function) in a few lines of code. You must specify three parameters: (1) the function to create a GUI for (2) the desired input components and (3) the desired output components. Additional parameters can be used to control the appearance and behavior of the demo."},{"gradio":"Callable"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"str | IOComponent | List[str | IOComponent] | None"},{"gradio":"required"},{"gradio":"a single Gradio component, or list of Gradio components. Components can either be passed as instantiated objects, or referred to by their string shortcuts. The number of input components should match the number of parameters in fn. If set to None, then only the output components will be displayed."},{"gradio":"str | IOComponent | List[str | IOComponent] | None"},{"gradio":"required"},{"gradio":"a single Gradio component, or list of Gradio components. Components can either be passed as instantiated objects, or referred to by their string shortcuts. The number of output components should match the number of values returned by fn. If set to None, then only the input components will be displayed."},{"gradio":"List[Any] | List[List[Any]] | str | None"},{"gradio":"default: None"},{"gradio":"sample inputs for the function; if provided, appear below the UI components and can be clicked to populate the interface. Should be nested list, in which the outer list consists of samples and each inner list consists of an input corresponding to each input component. A string path to a directory of examples can also be provided, but it should be within the directory with the python file running the gradio app. If there are multiple input components and a directory is provided, a log.csv file must be present in the directory to link corresponding inputs."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, caches examples in the server for fast runtime in examples. The default option in HuggingFace Spaces is True. The default option elsewhere is False."},{"gradio":"int"},{"gradio":"default: 10"},{"gradio":"If examples are provided, how many to display per page."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"whether the interface should automatically rerun if any of the inputs change."},{"gradio":"Callable | str | None"},{"gradio":"default: None"},{"gradio":"function that provides interpretation explaining prediction output. Pass \"default\" to use simple built-in interpreter, \"shap\" to use a built-in shapley-based interpreter, or your own custom interpretation function. For more information on the different interpretation methods, see the Advanced Interface Features guide."},{"gradio":"float"},{"gradio":"default: 2.0"},{"gradio":"a multiplier that determines how many examples are computed for shap-based interpretation. Increasing this value will increase shap runtime, but improve results. Only applies if interpretation is \"shap\"."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"a title for the interface; if provided, appears above the input and output components in large font. Also used as the tab title when opened in a browser window."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"a description for the interface; if provided, appears above the input and output components and beneath the title in regular font. Accepts Markdown and HTML content."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"an expanded article explaining the interface; if provided, appears below the input and output components in regular font. Accepts Markdown and HTML content."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"path or url to image to use as display image when the web demo is shared on social media."},{"gradio":"Theme | None"},{"gradio":"default: None"},{"gradio":"Theme to use, loaded from gradio.themes."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"custom css or path to custom css file to use with interface."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"one of \"never\", \"auto\", or \"manual\". If \"never\" or \"auto\", users will not see a button to flag an input and output. If \"manual\", users will see a button to flag. If \"auto\", every input the user submits will be automatically flagged (outputs are not flagged). If \"manual\", both the input and outputs are flagged when the user clicks flag button. This parameter can be set with environmental variable GRADIO_ALLOW_FLAGGING; otherwise defaults to \"manual\"."},{"gradio":"List[str] | List[Tuple[str, str]] | None"},{"gradio":"default: None"},{"gradio":"if provided, allows user to select from the list of options when flagging. Only applies if allow_flagging is \"manual\". Can either be a list of tuples of the form (label, value), where label is the string that will be displayed on the button and value is the string that will be stored in the flagging CSV; or it can be a list of strings [\"X\", \"Y\"], in which case the values will be the list of strings and the labels will [\"Flag as X\", \"Flag as Y\"], etc."},{"gradio":"str"},{"gradio":"default: \"flagged\""},{"gradio":"what to name the directory where flagged data is stored."},{"gradio":"FlaggingCallback"},{"gradio":"default: CSVLogger()"},{"gradio":"An instance of a subclass of FlaggingCallback which will be called when a sample is flagged. By default logs to a local CSV file."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"Whether to allow basic telemetry. If None, will use GRADIO_ANALYTICS_ENABLED environment variable if defined, or default to True."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"Launches a simple web server that serves the demo. Can also be used to create a public link used by anyone to access the demo from their browser by setting share=True."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"whether to display in the interface inline in an iframe. Defaults to True in python notebooks; False otherwise."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"whether to automatically launch the interface in a new tab on the default browser."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"whether to create a publicly shareable link for the interface. Creates an SSH tunnel to make your UI accessible from anywhere. If not provided, it is set to False by default every time, except when running in Google Colab. When localhost is not accessible (e.g. Google Colab), setting share=False is not supported."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"if True, blocks the main thread from running. If running in Google Colab, this is needed to print the errors in the cell output."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"DEPRECATED (use .queue() method instead.) if True, inference requests will be served through a queue instead of with parallel threads. Required for longer inference times (> 1min) to prevent timeout. The default option in HuggingFace Spaces is True. The default option elsewhere is False."},{"gradio":"int"},{"gradio":"default: 40"},{"gradio":"the maximum number of total threads that the Gradio app can generate in parallel. The default is inherited from the starlette library (currently 40). Applies whether the queue is enabled or not. But if queuing is enabled, this parameter is increaseed to be at least the concurrency_count of the queue."},{"gradio":"Callable | Tuple[str, str] | List[Tuple[str, str]] | None"},{"gradio":"default: None"},{"gradio":"If provided, username and password (or list of username-password tuples) required to access interface. Can also provide function that takes username and password and returns True if valid login."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"If provided, HTML message provided on login page."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, the interface will block the main thread while the server is running."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, any errors in the interface will be displayed in an alert modal and printed in the browser console log"},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"to make app accessible on local network, set this to \"0.0.0.0\". Can be set by environment variable GRADIO_SERVER_NAME. If None, will use \"127.0.0.1\"."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"will start gradio app on this port (if available). Can be set by environment variable GRADIO_SERVER_PORT. If None, will search for an available port starting at 7860."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"if True, will occasionally show tips about new Gradio features"},{"gradio":"int"},{"gradio":"default: 500"},{"gradio":"The height in pixels of the iframe element containing the interface (used if inline=True)"},{"gradio":"int | str"},{"gradio":"default: \"100%\""},{"gradio":"The width in pixels of the iframe element containing the interface (used if inline=True)"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"DEPRECATED. Has no effect."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"If a path to a file (.png, .gif, or .ico) is provided, it will be used as the favicon for the web page."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"If a path to a file is provided, will use this as the private key file to create a local server running on https."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"If a path to a file is provided, will use this as the signed certificate for https. Needs to be provided if ssl_keyfile is provided."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"If a password is provided, will use this with the ssl certificate for https."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, suppresses most print statements."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If True, shows the api docs in the footer of the app. Default True. If the queue is enabled, then api_open parameter of .queue() will determine if the api docs are shown, independent of the value of show_api."},{"gradio":"List[str] | None"},{"gradio":"default: None"},{"gradio":"List of directories that gradio is allowed to serve files from (in addition to the directory containing the gradio python file). Must be absolute paths. Warning: any files in these directories or its children are potentially accessible to all users of your app."},{"gradio":"Class method that constructs an Interface from a Hugging Face repo. Can accept model repos (if src is \"models\") or Space repos (if src is \"spaces\"). The input and output components are automatically loaded from the repo."},{"gradio":"str"},{"gradio":"required"},{"gradio":"the name of the model (e.g. \"gpt2\" or \"facebook/bart-base\") or space (e.g. \"flax-community/spanish-gpt2\"), can include the `src` as prefix (e.g. \"models/facebook/bart-base\")"},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"the source of the model: `models` or `spaces` (or leave empty if source is provided as a prefix in `name`)"},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"optional access token for loading private Hugging Face Hub models or spaces. Find your token here: https://huggingface.co/settings/tokens"},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"optional string used as the name of the loaded model instead of the default name (only applies if loading a Space running Gradio 2.x)"},{"gradio":"Class method that constructs an Interface from a Hugging Face transformers.Pipeline object. The input and output components are automatically determined from the pipeline."},{"gradio":"Pipeline"},{"gradio":"required"},{"gradio":"the pipeline object to use."},{"gradio":"A catch-all method for integrating with other libraries. This method should be run after launch()"},{"gradio":"comet_ml.Experiment | None"},{"gradio":"default: None"},{"gradio":"If a comet_ml Experiment object is provided, will integrate with the experiment and appear on Comet dashboard"},{"gradio":"ModuleType | None"},{"gradio":"default: None"},{"gradio":"If the wandb module is provided, will integrate with it and appear on WandB dashboard"},{"gradio":"ModuleType | None"},{"gradio":"default: None"},{"gradio":"If the mlflow module is provided, will integrate with the experiment and appear on ML Flow dashboard"},{"gradio":"You can control the rate of processed requests by creating a queue. This will allow you to set the number of requests to be processed at one time, and will let users know their position in the queue."},{"gradio":"int"},{"gradio":"default: 1"},{"gradio":"Number of worker threads that will be processing requests from the queue concurrently. Increasing this number will increase the rate at which requests are processed, but will also increase the memory usage of the queue."},{"gradio":"float | Literal['auto']"},{"gradio":"default: \"auto\""},{"gradio":"If \"auto\", Queue will send status estimations to all clients whenever a job is finished. Otherwise Queue will send status at regular intervals set by this parameter as the number of seconds."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"DEPRECATED. This parameter is deprecated and has no effect."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"Deprecated and has no effect."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If True, the REST routes of the backend will be open, allowing requests made directly to those endpoints to skip the queue."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"The maximum number of events the queue will store at any given moment. If the queue is full, new events will not be added and a user will receive a message saying that the queue is full. If None, the queue size will be unlimited."},{"gradio":"Quickstart"},{"gradio":"A Gradio Interface includes a \"Flag\" button that appears underneath the output. By default, clicking on the Flag button sends the input and output data back to the machine where the gradio demo is running, and saves it to a CSV log file. But this default behavior can be changed. To set what happens when the Flag button is clicked, you pass an instance of a subclass of FlaggingCallback to the flagging_callback parameter in the Interface constructor. You can use one of the FlaggingCallback subclasses that are listed below, or you can create your own, which lets you do whatever you want with the data that is being flagged."},{"gradio":"A simplified implementation of the FlaggingCallback abstract class provided for illustrative purposes. Each flagged sample (both the input and output data) is logged to a CSV file on the machine running the gradio app."},{"gradio":"No guides yet, contribute a guide about SimpleCSVLogger"},{"gradio":"The default implementation of the FlaggingCallback abstract class. Each flagged sample (both the input and output data) is logged to a CSV file with headers on the machine running the gradio app."},{"gradio":"No guides yet, contribute a guide about CSVLogger"},{"gradio":"A callback that saves each flagged sample (both the input and output data) to a HuggingFace dataset."},{"gradio":"str"},{"gradio":"required"},{"gradio":"The HuggingFace token to use to create (and write the flagged sample to) the HuggingFace dataset."},{"gradio":"str"},{"gradio":"required"},{"gradio":"The name of the dataset to save the data to, e.g. \"image-classifier-1\""},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The organization to save the dataset under. The hf_token must provide write access to this organization. If not provided, saved under the name of the user corresponding to the hf_token."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"Whether the dataset should be private (defaults to False)."},{"gradio":"No guides yet, contribute a guide about HuggingFaceDatasetSaver"},{"gradio":"Once you have created several Interfaces, we provide several classes that let you start combining them together. For example, you can chain them in Series or compare their outputs in Parallel if the inputs and outputs match accordingly. You can also display arbitrary Interfaces together in a tabbed layout using TabbedInterface."},{"gradio":"Loading..."},{"gradio":"A TabbedInterface is created by providing a list of Interfaces, each of which gets rendered in a separate tab."},{"gradio":"List[Interface]"},{"gradio":"required"},{"gradio":"a list of interfaces to be rendered in tabs."},{"gradio":"List[str] | None"},{"gradio":"default: None"},{"gradio":"a list of tab names. If None, the tab names will be \"Tab 1\", \"Tab 2\", etc."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"a title for the interface; if provided, appears above the input and output components in large font. Also used as the tab title when opened in a browser window."},{"gradio":"Theme | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"whether to allow basic telemetry. If None, will use GRADIO_ANALYTICS_ENABLED environment variable or default to True."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"custom css or path to custom css file to apply to entire Blocks"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Creates a new Interface consisting of multiple Interfaces in parallel (comparing their outputs). The Interfaces to put in Parallel must share the same input components (but can have different output components)."},{"gradio":null},{"gradio":"required"},{"gradio":"any number of Interface objects that are to be compared in parallel"},{"gradio":null},{"gradio":"additional kwargs that are passed into the new Interface object to customize it"},{"gradio":"No guides yet, contribute a guide about Parallel"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Creates a new Interface from multiple Interfaces in series (the output of one is fed as the input to the next, and so the input and output components must agree between the interfaces)."},{"gradio":null},{"gradio":"required"},{"gradio":"any number of Interface objects that are to be connected in series"},{"gradio":null},{"gradio":"additional kwargs that are passed into the new Interface object to customize it"},{"gradio":"No guides yet, contribute a guide about Series"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Blocks is Gradio's low-level API that allows you to create more custom web applications and demos than Interfaces (yet still entirely in Python).\n\nCompared to the Interface class, Blocks offers more flexibility and control over: (1) the layout of components (2) the events that trigger the execution of functions (3) data flows (e.g. inputs can trigger outputs, which can trigger the next level of outputs). Blocks also offers ways to group together related demos such as with tabs.\n\nThe basic usage of Blocks is as follows: create a Blocks object, then use it as a context (with the \"with\" statement), and then define layouts, components, or events within the Blocks context. Finally, call the launch() method to launch the demo."},{"gradio":"Theme | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"whether to allow basic telemetry. If None, will use GRADIO_ANALYTICS_ENABLED environment variable or default to True."},{"gradio":"str"},{"gradio":"default: \"blocks\""},{"gradio":"a human-friendly name for the kind of Blocks or Interface being created."},{"gradio":"str"},{"gradio":"default: \"Gradio\""},{"gradio":"The tab title to display when this is opened in a browser window."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"custom css or path to custom css file to apply to entire Blocks"},{"gradio":"Launches a simple web server that serves the demo. Can also be used to create a public link used by anyone to access the demo from their browser by setting share=True."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"whether to display in the interface inline in an iframe. Defaults to True in python notebooks; False otherwise."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"whether to automatically launch the interface in a new tab on the default browser."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"whether to create a publicly shareable link for the interface. Creates an SSH tunnel to make your UI accessible from anywhere. If not provided, it is set to False by default every time, except when running in Google Colab. When localhost is not accessible (e.g. Google Colab), setting share=False is not supported."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"if True, blocks the main thread from running. If running in Google Colab, this is needed to print the errors in the cell output."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"DEPRECATED (use .queue() method instead.) if True, inference requests will be served through a queue instead of with parallel threads. Required for longer inference times (> 1min) to prevent timeout. The default option in HuggingFace Spaces is True. The default option elsewhere is False."},{"gradio":"int"},{"gradio":"default: 40"},{"gradio":"the maximum number of total threads that the Gradio app can generate in parallel. The default is inherited from the starlette library (currently 40). Applies whether the queue is enabled or not. But if queuing is enabled, this parameter is increaseed to be at least the concurrency_count of the queue."},{"gradio":"Callable | Tuple[str, str] | List[Tuple[str, str]] | None"},{"gradio":"default: None"},{"gradio":"If provided, username and password (or list of username-password tuples) required to access interface. Can also provide function that takes username and password and returns True if valid login."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"If provided, HTML message provided on login page."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, the interface will block the main thread while the server is running."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, any errors in the interface will be displayed in an alert modal and printed in the browser console log"},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"to make app accessible on local network, set this to \"0.0.0.0\". Can be set by environment variable GRADIO_SERVER_NAME. If None, will use \"127.0.0.1\"."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"will start gradio app on this port (if available). Can be set by environment variable GRADIO_SERVER_PORT. If None, will search for an available port starting at 7860."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"if True, will occasionally show tips about new Gradio features"},{"gradio":"int"},{"gradio":"default: 500"},{"gradio":"The height in pixels of the iframe element containing the interface (used if inline=True)"},{"gradio":"int | str"},{"gradio":"default: \"100%\""},{"gradio":"The width in pixels of the iframe element containing the interface (used if inline=True)"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"DEPRECATED. Has no effect."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"If a path to a file (.png, .gif, or .ico) is provided, it will be used as the favicon for the web page."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"If a path to a file is provided, will use this as the private key file to create a local server running on https."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"If a path to a file is provided, will use this as the signed certificate for https. Needs to be provided if ssl_keyfile is provided."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"If a password is provided, will use this with the ssl certificate for https."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, suppresses most print statements."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If True, shows the api docs in the footer of the app. Default True. If the queue is enabled, then api_open parameter of .queue() will determine if the api docs are shown, independent of the value of show_api."},{"gradio":"List[str] | None"},{"gradio":"default: None"},{"gradio":"List of directories that gradio is allowed to serve files from (in addition to the directory containing the gradio python file). Must be absolute paths. Warning: any files in these directories or its children are potentially accessible to all users of your app."},{"gradio":"You can control the rate of processed requests by creating a queue. This will allow you to set the number of requests to be processed at one time, and will let users know their position in the queue."},{"gradio":"int"},{"gradio":"default: 1"},{"gradio":"Number of worker threads that will be processing requests from the queue concurrently. Increasing this number will increase the rate at which requests are processed, but will also increase the memory usage of the queue."},{"gradio":"float | Literal['auto']"},{"gradio":"default: \"auto\""},{"gradio":"If \"auto\", Queue will send status estimations to all clients whenever a job is finished. Otherwise Queue will send status at regular intervals set by this parameter as the number of seconds."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"DEPRECATED. This parameter is deprecated and has no effect."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"Deprecated and has no effect."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If True, the REST routes of the backend will be open, allowing requests made directly to those endpoints to skip the queue."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"The maximum number of events the queue will store at any given moment. If the queue is full, new events will not be added and a user will receive a message saying that the queue is full. If None, the queue size will be unlimited."},{"gradio":"A catch-all method for integrating with other libraries. This method should be run after launch()"},{"gradio":"comet_ml.Experiment | None"},{"gradio":"default: None"},{"gradio":"If a comet_ml Experiment object is provided, will integrate with the experiment and appear on Comet dashboard"},{"gradio":"ModuleType | None"},{"gradio":"default: None"},{"gradio":"If the wandb module is provided, will integrate with it and appear on WandB dashboard"},{"gradio":"ModuleType | None"},{"gradio":"default: None"},{"gradio":"If the mlflow module is provided, will integrate with the experiment and appear on ML Flow dashboard"},{"gradio":"For reverse compatibility reasons, this is both a class method and an instance method, the two of which, confusingly, do two completely different things.\n\nClass method: loads a demo from a Hugging Face Spaces repo and creates it locally and returns a block instance. Equivalent to gradio.Interface.load()\n\nInstance method: adds event that runs as soon as the demo loads in the browser. Example usage below."},{"gradio":"Callable | None"},{"gradio":"default: None"},{"gradio":"Instance Method - the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"List[Component] | None"},{"gradio":"default: None"},{"gradio":"Instance Method - List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"List[Component] | None"},{"gradio":"default: None"},{"gradio":"Instance Method - List of gradio.components to use as inputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Instance Method - Defining this parameter exposes the endpoint in the api docs"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"Instance Method - If True, will scroll to output component on completion"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"Instance Method - If True, will show progress animation while pending"},{"gradio":null},{"gradio":"default: None"},{"gradio":"Instance Method - If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"Instance Method - If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Instance Method - Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"Instance Method - If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"Instance Method - If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Instance Method - Run this event 'every' number of seconds. Interpreted in seconds. Queue must be enabled."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Class Method - the name of the model (e.g. \"gpt2\" or \"facebook/bart-base\") or space (e.g. \"flax-community/spanish-gpt2\"), can include the `src` as prefix (e.g. \"models/facebook/bart-base\")"},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Class Method - the source of the model: `models` or `spaces` (or leave empty if source is provided as a prefix in `name`)"},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Class Method - optional access token for loading private Hugging Face Hub models or spaces. Find your token here: https://huggingface.co/settings/tokens"},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Class Method - optional string used as the name of the loaded model instead of the default name (only applies if loading a Space running Gradio 2.x)"},{"gradio":"No guides yet, contribute a guide about Blocks"},{"gradio":"Customize the layout of your Blocks UI with the layout classes below."},{"gradio":"Row is a layout element within Blocks that renders all children horizontally."},{"gradio":"str"},{"gradio":"default: \"default\""},{"gradio":"row type, 'default' (no background), 'panel' (gray background color and rounded corners), or 'compact' (rounded corners and no internal gap)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, row will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"No guides yet, contribute a guide about Row"},{"gradio":"Column is a layout element within Blocks that renders all children vertically. The widths of columns can be set through the `scale` and `min_width` parameters. If a certain scale results in a column narrower than min_width, the min_width parameter will win."},{"gradio":"int"},{"gradio":"default: 1"},{"gradio":"relative width compared to adjacent Columns. For example, if Column A has scale=2, and Column B has scale=1, A will be twice as wide as B."},{"gradio":"int"},{"gradio":"default: 320"},{"gradio":"minimum pixel width of Column, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in a column narrower than min_width, the min_width parameter will be respected first."},{"gradio":"str"},{"gradio":"default: \"default\""},{"gradio":"column type, 'default' (no background), 'panel' (gray background color and rounded corners), or 'compact' (rounded corners and no internal gap)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, column will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"No guides yet, contribute a guide about Column"},{"gradio":"Tab (or its alias TabItem) is a layout element. Components defined within the Tab will be visible when this tab is selected tab."},{"gradio":"str"},{"gradio":"required"},{"gradio":"The visual label for the tab"},{"gradio":"int | str | None"},{"gradio":"default: None"},{"gradio":"An optional identifier for the tab, required if you wish to control the selected tab from a predict function."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"This event is triggered when the user selects from within the Component. This event has EventData of type gradio.SelectData that carries information, accessible through SelectData.index and SelectData.value. See EventData documentation on how to use this event data."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Tab"},{"gradio":"Box is a a layout element which places children in a box with rounded corners and some padding around them."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, box will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"No guides yet, contribute a guide about Box"},{"gradio":"Accordion is a layout element which can be toggled to show/hide the contained content."},{"gradio":null},{"gradio":"required"},{"gradio":"name of accordion section."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, accordion is open by default."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":null},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"No guides yet, contribute a guide about Accordion"},{"gradio":"Gradio includes pre-built components that can be used as inputs or outputs in your Interface or Blocks with a single line of code. Components include preprocessing steps that convert user data submitted through browser to something that be can used by a Python function, and postprocessing steps to convert values returned by a Python function into something that can be displayed in a browser."},{"gradio":"Consider an example with three inputs (Textbox, Number, and Image) and two outputs (Number and Gallery), below is a diagram of what our preprocessing will send to the function and what our postprocessing will require from it."},{"gradio":"Components also come with certain events that they support. These are methods that are triggered with user actions. Below is a table showing which events are supported for each component. All events are also listed (with parameters) in the component's docs."},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"✕"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Creates an audio component that can be used to upload/record audio (as an input) or display audio (as an output)."},{"gradio":"As input: passes the uploaded audio as a Tuple(int, numpy.array) corresponding to (sample rate, data) or as a str filepath, depending on `type`"},{"gradio":"As output: expects a Tuple(int, numpy.array) corresponding to (sample rate, data) or as a str filepath or URL to an audio file, which gets displayed"},{"gradio":"Format expected for examples: a str filepath to a local file that contains audio."},{"gradio":"str | Tuple[int, np.ndarray] | Callable | None"},{"gradio":"default: None"},{"gradio":"A path, URL, or [sample_rate, numpy array] tuple for the default value that Audio component is going to take. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"str"},{"gradio":"default: \"upload\""},{"gradio":"Source of audio. \"upload\" creates a box where user can drop an audio file, \"microphone\" creates a microphone input."},{"gradio":"str"},{"gradio":"default: \"numpy\""},{"gradio":"The format the audio file is converted to before being passed into the prediction function. \"numpy\" converts the audio to a tuple consisting of: (int sample rate, numpy.array for the data), \"filepath\" passes a str path to a temporary file containing the audio."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"if True, will allow users to upload and edit a audio file; if False, can only be used to play audio. If not provided, this is inferred based on whether the component is used as an input or output."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If set to True when used in a `live` interface, will automatically stream webcam feed. Only valid is source is 'microphone'."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.Audio"},{"gradio":"\"audio\""},{"gradio":"gradio.Microphone"},{"gradio":"\"microphone\""},{"gradio":"This method can be used to change the appearance of the audio component."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user plays the component (e.g. audio or video). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user pauses the component (e.g. audio or video). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user stops the component (e.g. audio or video). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user streams the component (e.g. a live webcam component). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user uploads a file into the component (e.g. when the user uploads a video into a video component). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Audio"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Create a bar plot."},{"gradio":"As input: this component does *not* accept input."},{"gradio":"As output: expects a pandas dataframe with the data to plot."},{"gradio":"pd.DataFrame | Callable | None"},{"gradio":"default: None"},{"gradio":"The pandas dataframe containing the data to display in a scatter plot."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Column corresponding to the x axis."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Column corresponding to the y axis."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The column to determine the bar color. Must be categorical (discrete values)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If True, the bars will be displayed vertically. If False, the x and y axis will be switched, displaying the bars horizontally. Default is True."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The column with which to split the overall plot into smaller subplots."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The title to display on top of the chart."},{"gradio":"List[str] | str | None"},{"gradio":"default: None"},{"gradio":"The column (or list of columns) to display on the tooltip when a user hovers over a bar."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The title given to the x axis. By default, uses the value of the x parameter."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The title given to the y axis. By default, uses the value of the y parameter."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The title given to the color legend. By default, uses the value of color parameter."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The label displayed on top of the subplot columns (or rows if vertical=True). Use an empty string to omit."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The position of the color legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"The height of the plot in pixels."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"The width of the plot in pixels."},{"gradio":"List[int] | None"},{"gradio":"default: None"},{"gradio":"A tuple of list containing the limits for the y-axis, specified as [y_min, y_max]."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The (optional) caption to display below the plot."},{"gradio":"bool | None"},{"gradio":"default: True"},{"gradio":"Whether users should be able to interact with the plot by panning or zooming with their mouse or trackpad."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The (optional) label to display on the top left corner of the plot."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"Whether the label should be displayed."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"Whether the plot should be visible."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Unique id used for custom css targetting."},{"gradio":"gradio.BarPlot"},{"gradio":"\"barplot\""},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about BarPlot"},{"gradio":"Loading..."},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"Loading..."},{"gradio":"Used to create a button, that can be assigned arbitrary click() events. The label (value) of the button can be used as an input or set via the output of a function."},{"gradio":"As input: passes the button value as a str into the function"},{"gradio":"As output: expects a str to be returned from a function, which is set as the label of the button"},{"gradio":"str | Callable"},{"gradio":"default: \"Run\""},{"gradio":"Default text for the button to display. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"str"},{"gradio":"default: \"secondary\""},{"gradio":"'primary' for main call-to-action, 'secondary' for a more subdued style, 'stop' for a stop button."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":null},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.Button"},{"gradio":"\"button\""},{"gradio":"This method can be used to change the appearance of the button component."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will expand to fill parent container."},{"gradio":"Literal['sm'] | Literal['lg'] | None"},{"gradio":"default: None"},{"gradio":"Size of the button. Can be \"sm\" or \"lg\"."},{"gradio":"This event is triggered when the component (e.g. a button) is clicked. This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Button"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Displays a chatbot output showing both user submitted messages and responses. Supports a subset of Markdown including bold, italics, code, and images."},{"gradio":"As input: this component does *not* accept input."},{"gradio":"As output: expects function to return a List[Tuple[str | None | Tuple, str | None | Tuple]], a list of tuples with user message and response messages. Messages should be strings, tuples, or Nones. If the message is a string, it can include Markdown. If it is a tuple, it should consist of (string filepath to image/video/audio, [optional string alt text]). Messages that are `None` are not displayed."},{"gradio":"List[Tuple[str | None, str | None]] | Callable | None"},{"gradio":"default: None"},{"gradio":"Default value to show in chatbot. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"Dict[str, str] | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.Chatbot"},{"gradio":"\"chatbot\""},{"gradio":"This method can be used to change the appearance of the Chatbot component."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"Event listener for when the user selects message from Chatbot. Uses event data gradio.SelectData to carry `value` referring to text of selected message, and `index` tuple to refer to [message, participant] index. See EventData documentation on how to use this event data."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Chatbot"},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"Loading..."},{"gradio":"Creates a checkbox that can be set to `True` or `False`."},{"gradio":"As input: passes the status of the checkbox as a bool into the function."},{"gradio":"As output: expects a bool returned from the function and, if it is True, checks the checkbox."},{"gradio":"Format expected for examples: a bool representing whether the box is checked."},{"gradio":"bool | Callable"},{"gradio":"default: False"},{"gradio":"if True, checked by default. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"additional component description."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"if True, this checkbox can be checked; if False, checking will be disabled. If not provided, this is inferred based on whether the component is used as an input or output."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.Checkbox"},{"gradio":"\"checkbox\""},{"gradio":"This method can be used to change the appearance of the component."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the component in a container - providing some extra padding around the border."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"Event listener for when the user selects or deselects Checkbox. Uses event data gradio.SelectData to carry `value` referring to label of checkbox, and `selected` to refer to state of checkbox. See EventData documentation on how to use this event data."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Checkbox"},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"Loading..."},{"gradio":"Creates a set of checkboxes of which a subset can be checked."},{"gradio":"As input: passes the list of checked checkboxes as a List[str] or their indices as a List[int] into the function, depending on `type`."},{"gradio":"As output: expects a List[str], each element of which becomes a checked checkbox."},{"gradio":"Format expected for examples: a List[str] representing the values to be checked."},{"gradio":"List[str] | None"},{"gradio":"default: None"},{"gradio":"list of options to select from."},{"gradio":"List[str] | str | Callable | None"},{"gradio":"default: None"},{"gradio":"default selected list of options. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"str"},{"gradio":"default: \"value\""},{"gradio":"Type of value to be returned by component. \"value\" returns the list of strings of the choices selected, \"index\" returns the list of indicies of the choices selected."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"additional component description."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"if True, choices in this checkbox group will be checkable; if False, checking will be disabled. If not provided, this is inferred based on whether the component is used as an input or output."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.CheckboxGroup"},{"gradio":"\"checkboxgroup\""},{"gradio":"This method can be used to change the appearance of the CheckboxGroup."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the items in a container."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the component in a container - providing some extra padding around the border."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"Event listener for when the user selects or deselects within CheckboxGroup. Uses event data gradio.SelectData to carry `value` referring to label of selected checkbox, `index` to refer to index, and `selected` to refer to state of checkbox. See EventData documentation on how to use this event data."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about CheckboxGroup"},{"gradio":"Loading..."},{"gradio":"Creates a Code editor for entering, editing or viewing code."},{"gradio":"As input: passes a str of code into the function."},{"gradio":"As output: expects the function to return a str of code or a single-elment tuple: (string filepath,)"},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Default value to show in the code editor. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The language to display the code as. Supported languages listed in `gr.Code.languages`."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"Whether user should be able to enter code or only view it."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.Code"},{"gradio":"\"code\""},{"gradio":"['python', 'markdown', 'json', 'html', 'css', 'javascript', 'typescript', 'yaml', 'dockerfile', 'shell', 'r', None]"},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Code"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Creates a color picker for user to select a color as string input."},{"gradio":"As input: passes selected color value as a str into the function."},{"gradio":"As output: expects a str returned from function and sets color picker value to it."},{"gradio":"Format expected for examples: a str with a hexadecimal representation of a color, e.g. \"#ff0000\" for red."},{"gradio":"str | Callable | None"},{"gradio":"default: None"},{"gradio":"default text to provide in color picker. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"additional component description."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"if True, will be rendered as an editable color picker; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.ColorPicker"},{"gradio":"\"colorpicker\""},{"gradio":"This method can be used to change the appearance of the component."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the component in a container - providing some extra padding around the border."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user presses the Enter key while the component (e.g. a textbox) is focused. This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about ColorPicker"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Accepts or displays 2D input through a spreadsheet-like component for dataframes."},{"gradio":"As input: passes the uploaded spreadsheet data as a pandas.DataFrame, numpy.array, List[List], or List depending on `type`"},{"gradio":"As output: expects a pandas.DataFrame, numpy.array, List[List], List, a Dict with keys `data` (and optionally `headers`), or str path to a csv, which is rendered in the spreadsheet."},{"gradio":"Format expected for examples: a str filepath to a csv with data, a pandas dataframe, or a list of lists (excluding headers) where each sublist is a row of data."},{"gradio":"List[List[Any]] | Callable | None"},{"gradio":"default: None"},{"gradio":"Default value as a 2-dimensional list of values. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"List[str] | None"},{"gradio":"default: None"},{"gradio":"List of str header names. If None, no headers are shown."},{"gradio":"int | Tuple[int, str]"},{"gradio":"default: (1, 'dynamic')"},{"gradio":"Limit number of rows for input and decide whether user can create new rows. The first element of the tuple is an `int`, the row count; the second should be 'fixed' or 'dynamic', the new row behaviour. If an `int` is passed the rows default to 'dynamic'"},{"gradio":"int | Tuple[int, str] | None"},{"gradio":"default: None"},{"gradio":"Limit number of columns for input and decide whether user can create new columns. The first element of the tuple is an `int`, the number of columns; the second should be 'fixed' or 'dynamic', the new column behaviour. If an `int` is passed the columns default to 'dynamic'"},{"gradio":"str | List[str]"},{"gradio":"default: \"str\""},{"gradio":"Datatype of values in sheet. Can be provided per column as a list of strings, or for the entire sheet as a single string. Valid datatypes are \"str\", \"number\", \"bool\", \"date\", and \"markdown\"."},{"gradio":"str"},{"gradio":"default: \"pandas\""},{"gradio":"Type of value to be returned by component. \"pandas\" for pandas dataframe, \"numpy\" for numpy array, or \"array\" for a Python array."},{"gradio":"int | None"},{"gradio":"default: 20"},{"gradio":"Maximum number of rows to display at once. Set to None for infinite."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"Maximum number of columns to display at once. Set to None for infinite."},{"gradio":"str"},{"gradio":"default: \"paginate\""},{"gradio":"If set to \"paginate\", will create pages for overflow rows. If set to \"show_ends\", will show initial and final rows and truncate middle rows."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"if True, will allow users to edit the dataframe; if False, can only be used to display data. If not provided, this is inferred based on whether the component is used as an input or output."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"if True text in table cells will wrap when appropriate, if False the table will scroll horiztonally. Defaults to False."},{"gradio":"gradio.Dataframe"},{"gradio":"\"dataframe\""},{"gradio":"gradio.Numpy"},{"gradio":"\"numpy\""},{"gradio":"gradio.Matrix"},{"gradio":"\"matrix\""},{"gradio":"gradio.List"},{"gradio":"\"list\""},{"gradio":"This method can be used to change the appearance of the DataFrame component."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"Event listener for when the user selects cell within Dataframe. Uses event data gradio.SelectData to carry `value` referring to value of selected cell, and `index` tuple to refer to index row and column. See EventData documentation on how to use this event data."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Dataframe"},{"gradio":"Loading..."},{"gradio":"Used to create an output widget for showing datasets. Used to render the examples box."},{"gradio":"As input: passes the selected sample either as a list of data (if type=\"value\") or as an int index (if type=\"index\")"},{"gradio":"As output: expects a list of lists corresponding to the dataset data."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"List[IOComponent] | List[str]"},{"gradio":"required"},{"gradio":"Which component types to show in this dataset widget, can be passed in as a list of string names or Components instances. The following components are supported in a Dataset: Audio, Checkbox, CheckboxGroup, ColorPicker, Dataframe, Dropdown, File, HTML, Image, Markdown, Model3D, Number, Radio, Slider, Textbox, TimeSeries, Video"},{"gradio":"List[List[Any]] | None"},{"gradio":"default: None"},{"gradio":"a nested list of samples. Each sublist within the outer list represents a data sample, and each element within the sublist represents an value for each component"},{"gradio":"List[str] | None"},{"gradio":"default: None"},{"gradio":"Column headers in the Dataset widget, should be the same len as components. If not provided, inferred from component labels"},{"gradio":"str"},{"gradio":"default: \"values\""},{"gradio":"'values' if clicking on a sample should pass the value of the sample, or \"index\" if it should pass the index of the sample"},{"gradio":"int"},{"gradio":"default: 10"},{"gradio":"how many examples to show per page."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.Dataset"},{"gradio":"\"dataset\""},{"gradio":"This method can be used to change the appearance of the Dataset component."},{"gradio":"This event is triggered when the component (e.g. a button) is clicked. This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user selects from within the Component. This event has EventData of type gradio.SelectData that carries information, accessible through SelectData.index and SelectData.value. See EventData documentation on how to use this event data."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Dataset"},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"Loading..."},{"gradio":"Creates a dropdown of choices from which entries can be selected."},{"gradio":"As input: passes the value of the selected dropdown entry as a str or its index as an int into the function, depending on `type`."},{"gradio":"As output: expects a str corresponding to the value of the dropdown entry to be selected."},{"gradio":"Format expected for examples: a str representing the drop down value to select."},{"gradio":"str | List[str] | None"},{"gradio":"default: None"},{"gradio":"list of options to select from."},{"gradio":"str | List[str] | Callable | None"},{"gradio":"default: None"},{"gradio":"default value(s) selected in dropdown. If None, no value is selected by default. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"str"},{"gradio":"default: \"value\""},{"gradio":"Type of value to be returned by component. \"value\" returns the string of the choice selected, \"index\" returns the index of the choice selected."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"if True, multiple choices can be selected."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"maximum number of choices that can be selected. If None, no limit is enforced."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"additional component description."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"if True, choices in this dropdown will be selectable; if False, selection will be disabled. If not provided, this is inferred based on whether the component is used as an input or output."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.Dropdown"},{"gradio":"\"dropdown\""},{"gradio":"This method can be used to change the appearance of the Dropdown."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the component in a container - providing some extra padding around the border."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"Event listener for when the user selects Dropdown option. Uses event data gradio.SelectData to carry `value` referring to label of selected option, and `index` to refer to index. See EventData documentation on how to use this event data."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Dropdown"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Creates a file component that allows uploading generic file (when used as an input) and or displaying generic files (output)."},{"gradio":"As input: passes the uploaded file as a file-object or List[file-object] depending on `file_count` (or a bytes/Listbytes depending on `type`)"},{"gradio":"As output: expects function to return a str path to a file, or List[str] consisting of paths to files."},{"gradio":"Format expected for examples: a str path to a local file that populates the component."},{"gradio":"str | List[str] | Callable | None"},{"gradio":"default: None"},{"gradio":"Default file to display, given as str file path. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"str"},{"gradio":"default: \"single\""},{"gradio":"if single, allows user to upload one file. If \"multiple\", user uploads multiple files. If \"directory\", user uploads all files in selected directory. Return type will be list for each file in case of \"multiple\" or \"directory\"."},{"gradio":"List[str] | None"},{"gradio":"default: None"},{"gradio":"List of file extensions or types of files to be uploaded (e.g. ['image', '.json', '.mp4']). \"file\" allows any file to be uploaded, \"image\" allows only image files to be uploaded, \"audio\" allows only audio files to be uploaded, \"video\" allows only video files to be uploaded, \"text\" allows only text files to be uploaded."},{"gradio":"str"},{"gradio":"default: \"file\""},{"gradio":"Type of value to be returned by component. \"file\" returns a temporary file object with the same base name as the uploaded file, whose full path can be retrieved by file_obj.name, \"binary\" returns an bytes object."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"if True, will allow users to upload a file; if False, can only be used to display files. If not provided, this is inferred based on whether the component is used as an input or output."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.File"},{"gradio":"\"file\""},{"gradio":"gradio.Files"},{"gradio":"\"files\""},{"gradio":"This method can be used to change the appearance of the file component."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user uploads a file into the component (e.g. when the user uploads a video into a video component). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"Event listener for when the user selects file from list. Uses event data gradio.SelectData to carry `value` referring to name of selected file, and `index` to refer to index. See EventData documentation on how to use this event data."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about File"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Used to display a list of images as a gallery that can be scrolled through."},{"gradio":"As input: this component does *not* accept input."},{"gradio":"As output: expects a list of images in any format, List[numpy.array | PIL.Image | str], or a List of (image, str caption) tuples and displays them."},{"gradio":"List[np.ndarray | _Image.Image | str] | Callable | None"},{"gradio":"default: None"},{"gradio":"List of images to display in the gallery by default. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.Gallery"},{"gradio":"\"gallery\""},{"gradio":"This method can be used to change the appearance of the gallery component."},{"gradio":"int | Tuple | None"},{"gradio":"default: None"},{"gradio":"Represents the number of images that should be shown in one row, for each of the six standard screen sizes (<576px, <768px, <992px, <1200px, <1400px, >1400px). if fewer that 6 are given then the last will be used for all subsequent breakpoints"},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Height of the gallery."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place gallery in a container - providing some extra padding around the border."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will display the Gallery in preview mode, which shows all of the images as thumbnails and allows the user to click on them to view them in full size."},{"gradio":"Event listener for when the user selects image within Gallery. Uses event data gradio.SelectData to carry `value` referring to caption of selected image, and `index` to refer to index. See EventData documentation on how to use this event data."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Gallery"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Used to display arbitrary HTML output."},{"gradio":"As input: this component does *not* accept input."},{"gradio":"As output: expects a valid HTML str."},{"gradio":"str | Callable"},{"gradio":"default: \"\""},{"gradio":"Default value. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.HTML"},{"gradio":"\"html\""},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about HTML"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Displays text that contains spans that are highlighted by category or numerical value."},{"gradio":"As input: this component does *not* accept input."},{"gradio":"As output: expects a List[Tuple[str, float | str]]] consisting of spans of text and their associated labels, or a Dict with two keys: (1) \"text\" whose value is the complete text, and \"entities\", which is a list of dictionaries, each of which have the keys: \"entity\" (consisting of the entity label), \"start\" (the character index where the label starts), and \"end\" (the character index where the label ends). Entities should not overlap."},{"gradio":"List[Tuple[str, str | float | None]] | Dict | Callable | None"},{"gradio":"default: None"},{"gradio":"Default value to show. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"Dict[str, str] | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"whether to show span categories in a separate legend or inline."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will merge the labels of adjacent tokens belonging to the same category."},{"gradio":"str"},{"gradio":"default: \"\""},{"gradio":"Specifies the separator to be used between tokens if combine_adjacent is True."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.HighlightedText"},{"gradio":"\"highlightedtext\""},{"gradio":"This method can be used to change the appearance of the HighlightedText component."},{"gradio":"Dict[str, str] | None"},{"gradio":"default: None"},{"gradio":"Map between category and respective colors."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the component in a container - providing some extra padding around the border."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"Event listener for when the user selects Highlighted text span. Uses event data gradio.SelectData to carry `value` referring to selected [text, label] tuple, and `index` to refer to span index. See EventData documentation on how to use this event data."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about HighlightedText"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Creates an image component that can be used to upload/draw images (as an input) or display images (as an output)."},{"gradio":"As input: passes the uploaded image as a numpy.array, PIL.Image or str filepath depending on `type` -- unless `tool` is `sketch` AND source is one of `upload` or `webcam`. In these cases, a dict with keys `image` and `mask` is passed, and the format of the corresponding values depends on `type`."},{"gradio":"As output: expects a numpy.array, PIL.Image or str or pathlib.Path filepath to an image and displays the image."},{"gradio":"Format expected for examples: a str filepath to a local file that contains the image."},{"gradio":"str | _Image.Image | np.ndarray | None"},{"gradio":"default: None"},{"gradio":"A PIL Image, numpy array, path or URL for the default value that Image component is going to take. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"Tuple[int, int] | None"},{"gradio":"default: None"},{"gradio":"(width, height) shape to crop and resize image to; if None, matches input image size. Pass None for either width or height to only crop and resize the other."},{"gradio":"str"},{"gradio":"default: \"RGB\""},{"gradio":"\"RGB\" if color, or \"L\" if black and white."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"whether to invert the image as a preprocessing step."},{"gradio":"str"},{"gradio":"default: \"upload\""},{"gradio":"Source of image. \"upload\" creates a box where user can drop an image file, \"webcam\" allows user to take snapshot from their webcam, \"canvas\" defaults to a white image that can be edited and drawn upon with tools."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Tools used for editing. \"editor\" allows a full screen editor (and is the default if source is \"upload\" or \"webcam\"), \"select\" provides a cropping and zoom tool, \"sketch\" allows you to create a binary sketch (and is the default if source=\"canvas\"), and \"color-sketch\" allows you to created a sketch in different colors. \"color-sketch\" can be used with source=\"upload\" or \"webcam\" to allow sketching on an image. \"sketch\" can also be used with \"upload\" or \"webcam\" to create a mask over an image and in that case both the image and mask are passed into the function as a dictionary with keys \"image\" and \"mask\" respectively."},{"gradio":"str"},{"gradio":"default: \"numpy\""},{"gradio":"The format the image is converted to before being passed into the prediction function. \"numpy\" converts the image to a numpy array with shape (width, height, 3) and values from 0 to 255, \"pil\" converts the image to a PIL image object, \"filepath\" passes a str path to a temporary file containing the image."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"if True, will allow users to upload and edit an image; if False, can only be used to display images. If not provided, this is inferred based on whether the component is used as an input or output."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True when used in a `live` interface, will automatically stream webcam feed. Only valid is source is 'webcam'."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If True webcam will be mirrored. Default is True."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"Size of the brush for Sketch. Default is None which chooses a sensible default"},{"gradio":"gradio.Image"},{"gradio":"\"image\""},{"gradio":"gradio.Webcam"},{"gradio":"\"webcam\""},{"gradio":"gradio.Sketchpad"},{"gradio":"\"sketchpad\""},{"gradio":"gradio.Paint"},{"gradio":"\"paint\""},{"gradio":"gradio.ImageMask"},{"gradio":"\"imagemask\""},{"gradio":"gradio.ImagePaint"},{"gradio":"\"imagepaint\""},{"gradio":"gradio.Pil"},{"gradio":"\"pil\""},{"gradio":"This method can be used to change the appearance of the Image component."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"Height of the image."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"Width of the image."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user edits the component (e.g. image) using the built-in editor. This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user streams the component (e.g. a live webcam component). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user uploads a file into the component (e.g. when the user uploads a video into a video component). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Image"},{"gradio":"Loading..."},{"gradio":"Used to create an interpretation widget for a component."},{"gradio":"As input: this component does *not* accept input."},{"gradio":"As output: expects a dict with keys \"original\" and \"interpretation\"."},{"gradio":"Component"},{"gradio":"required"},{"gradio":"Which component to show in the interpretation widget."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"Whether or not the interpretation is visible."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.Interpretation"},{"gradio":"\"interpretation\""},{"gradio":"No guides yet, contribute a guide about Interpretation"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Used to display arbitrary JSON output prettily."},{"gradio":"As input: this component does *not* accept input."},{"gradio":"As output: expects a str filepath to a file containing valid JSON -- or a list or dict that is valid JSON"},{"gradio":"str | Callable | None"},{"gradio":"default: None"},{"gradio":"Default value. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.JSON"},{"gradio":"\"json\""},{"gradio":"This method can be used to change the appearance of the JSON component."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the JSON in a container - providing some extra padding around the border."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about JSON"},{"gradio":"Loading..."},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"Loading..."},{"gradio":"Displays a classification label, along with confidence scores of top categories, if provided."},{"gradio":"As input: this component does *not* accept input."},{"gradio":"As output: expects a Dict[str, float] of classes and confidences, or str with just the class or an int/float for regression outputs, or a str path to a .json file containing a json dictionary in the structure produced by Label.postprocess()."},{"gradio":"Dict[str, float] | str | float | Callable | None"},{"gradio":"default: None"},{"gradio":"Default value to show in the component. If a str or number is provided, simply displays the string or number. If a {Dict[str, float]} of classes and confidences is provided, displays the top class on top and the `num_top_classes` below, along with their confidence bars. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"number of most confident classes to show."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The background color of the label (either a valid css color name or hexadecimal string)."},{"gradio":"gradio.Label"},{"gradio":"\"label\""},{"gradio":"This method can be used to change the appearance of the label component."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will add a container to the label - providing some extra padding around the border."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"Event listener for when the user selects a category from Label. Uses event data gradio.SelectData to carry `value` referring to name of selected category, and `index` to refer to index. See EventData documentation on how to use this event data."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Label"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Create a line plot."},{"gradio":"As input: this component does *not* accept input."},{"gradio":"As output: expects a pandas dataframe with the data to plot."},{"gradio":"pd.DataFrame | Callable | None"},{"gradio":"default: None"},{"gradio":"The pandas dataframe containing the data to display in a scatter plot."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Column corresponding to the x axis."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Column corresponding to the y axis."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The column to determine the point color. If the column contains numeric data, gradio will interpolate the column data so that small values correspond to light colors and large values correspond to dark values."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The column to determine the symbol used to draw the line, e.g. dashed lines, dashed lines with points."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"Whether to draw a point on the line for each (x, y) coordinate pair."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The title to display on top of the chart."},{"gradio":"List[str] | str | None"},{"gradio":"default: None"},{"gradio":"The column (or list of columns) to display on the tooltip when a user hovers a point on the plot."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The title given to the x axis. By default, uses the value of the x parameter."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The title given to the y axis. By default, uses the value of the y parameter."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The title given to the color legend. By default, uses the value of color parameter."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The title given to the stroke_dash legend. By default, uses the value of the stroke_dash parameter."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The position of the color legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The position of the stoke_dash legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"The height of the plot in pixels."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"The width of the plot in pixels."},{"gradio":"List[int] | None"},{"gradio":"default: None"},{"gradio":"A tuple or list containing the limits for the x-axis, specified as [x_min, x_max]."},{"gradio":"List[int] | None"},{"gradio":"default: None"},{"gradio":"A tuple of list containing the limits for the y-axis, specified as [y_min, y_max]."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The (optional) caption to display below the plot."},{"gradio":"bool | None"},{"gradio":"default: True"},{"gradio":"Whether users should be able to interact with the plot by panning or zooming with their mouse or trackpad."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The (optional) label to display on the top left corner of the plot."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"Whether the label should be displayed."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"Whether the plot should be visible."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Unique id used for custom css targetting."},{"gradio":"gradio.LinePlot"},{"gradio":"\"lineplot\""},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about LinePlot"},{"gradio":"Loading..."},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"Loading..."},{"gradio":"Used to render arbitrary Markdown output. Can also render latex enclosed by dollar signs."},{"gradio":"As input: this component does *not* accept input."},{"gradio":"As output: expects a valid str that can be rendered as Markdown."},{"gradio":"str | Callable"},{"gradio":"default: \"\""},{"gradio":"Value to show in Markdown component. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.Markdown"},{"gradio":"\"markdown\""},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Markdown"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Component allows users to upload or view 3D Model files (.obj, .glb, or .gltf)."},{"gradio":"As input: This component passes the uploaded file as a str filepath."},{"gradio":"As output: expects function to return a str path to a file of type (.obj, glb, or .gltf)"},{"gradio":"str | Callable | None"},{"gradio":"default: None"},{"gradio":"path to (.obj, glb, or .gltf) file to show in model3D viewer. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"List[float] | None"},{"gradio":"default: None"},{"gradio":"background color of scene"},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.Model3D"},{"gradio":"\"model3d\""},{"gradio":"This method can be used to change the appearance of the Model3D component."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user edits the component (e.g. image) using the built-in editor. This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Model3D"},{"gradio":"Loading..."},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Creates a numeric field for user to enter numbers as input or display numeric output."},{"gradio":"As input: passes field value as a float or int into the function, depending on `precision`."},{"gradio":"As output: expects an int or float returned from the function and sets field value to it."},{"gradio":"Format expected for examples: a float or int representing the number's value."},{"gradio":"float | Callable | None"},{"gradio":"default: None"},{"gradio":"default value. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"additional component description."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"if True, will be editable; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"Precision to round input/output to. If set to 0, will round to nearest integer and convert type to int. If None, no rounding happens."},{"gradio":"gradio.Number"},{"gradio":"\"number\""},{"gradio":"This method can be used to change the appearance of the component."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the component in a container - providing some extra padding around the border."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user presses the Enter key while the component (e.g. a textbox) is focused. This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the component's is unfocused/blurred (e.g. when the user clicks outside of a textbox). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Number"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"Loading..."},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"Loading..."},{"gradio":"Used to display various kinds of plots (matplotlib, plotly, or bokeh are supported)"},{"gradio":"As input: this component does *not* accept input."},{"gradio":"As output: expects either a matplotlib.figure.Figure, a plotly.graph_objects._figure.Figure, or a dict corresponding to a bokeh plot (json_item format)"},{"gradio":"Callable | None | pd.DataFrame"},{"gradio":"default: None"},{"gradio":"Optionally, supply a default plot object to display, must be a matplotlib, plotly, altair, or bokeh figure, or a callable. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.Plot"},{"gradio":"\"plot\""},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Plot"},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Creates a set of radio buttons of which only one can be selected."},{"gradio":"As input: passes the value of the selected radio button as a str or its index as an int into the function, depending on `type`."},{"gradio":"As output: expects a str corresponding to the value of the radio button to be selected."},{"gradio":"Format expected for examples: a str representing the radio option to select."},{"gradio":"List[str] | None"},{"gradio":"default: None"},{"gradio":"list of options to select from."},{"gradio":"str | Callable | None"},{"gradio":"default: None"},{"gradio":"the button selected by default. If None, no button is selected by default. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"str"},{"gradio":"default: \"value\""},{"gradio":"Type of value to be returned by component. \"value\" returns the string of the choice selected, \"index\" returns the index of the choice selected."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"additional component description."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"if True, choices in this radio group will be selectable; if False, selection will be disabled. If not provided, this is inferred based on whether the component is used as an input or output."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.Radio"},{"gradio":"\"radio\""},{"gradio":"This method can be used to change the appearance of the radio component."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place items in a container."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the component in a container - providing some extra padding around the border."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"Event listener for when the user selects Radio option. Uses event data gradio.SelectData to carry `value` referring to label of selected option, and `index` to refer to index. See EventData documentation on how to use this event data."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Radio"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Create a scatter plot."},{"gradio":"As input: this component does *not* accept input."},{"gradio":"As output: expects a pandas dataframe with the data to plot."},{"gradio":"pd.DataFrame | Callable | None"},{"gradio":"default: None"},{"gradio":"The pandas dataframe containing the data to display in a scatter plot, or a callable. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Column corresponding to the x axis."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Column corresponding to the y axis."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The column to determine the point color. If the column contains numeric data, gradio will interpolate the column data so that small values correspond to light colors and large values correspond to dark values."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The column used to determine the point size. Should contain numeric data so that gradio can map the data to the point size."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The column used to determine the point shape. Should contain categorical data. Gradio will map each unique value to a different shape."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The title to display on top of the chart."},{"gradio":"List[str] | str | None"},{"gradio":"default: None"},{"gradio":"The column (or list of columns) to display on the tooltip when a user hovers a point on the plot."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The title given to the x axis. By default, uses the value of the x parameter."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The title given to the y axis. By default, uses the value of the y parameter."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The title given to the color legend. By default, uses the value of color parameter."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The title given to the size legend. By default, uses the value of the size parameter."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The title given to the shape legend. By default, uses the value of the shape parameter."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The position of the color legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The position of the size legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The position of the shape legend. If the string value 'none' is passed, this legend is omitted. For other valid position values see: https://vega.github.io/vega/docs/legends/#orientation."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"The height of the plot in pixels."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"The width of the plot in pixels."},{"gradio":"List[int | float] | None"},{"gradio":"default: None"},{"gradio":"A tuple or list containing the limits for the x-axis, specified as [x_min, x_max]."},{"gradio":"List[int | float] | None"},{"gradio":"default: None"},{"gradio":"A tuple of list containing the limits for the y-axis, specified as [y_min, y_max]."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The (optional) caption to display below the plot."},{"gradio":"bool | None"},{"gradio":"default: True"},{"gradio":"Whether users should be able to interact with the plot by panning or zooming with their mouse or trackpad."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The (optional) label to display on the top left corner of the plot."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"Whether the label should be displayed."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"Whether the plot should be visible."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Unique id used for custom css targetting."},{"gradio":"gradio.ScatterPlot"},{"gradio":"\"scatterplot\""},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about ScatterPlot"},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Creates a slider that ranges from `minimum` to `maximum` with a step size of `step`."},{"gradio":"As input: passes slider value as a float into the function."},{"gradio":"As output: expects an int or float returned from function and sets slider value to it as long as it is within range."},{"gradio":"Format expected for examples: A float or int representing the slider's value."},{"gradio":"float"},{"gradio":"default: 0"},{"gradio":"minimum value for slider."},{"gradio":"float"},{"gradio":"default: 100"},{"gradio":"maximum value for slider."},{"gradio":"float | Callable | None"},{"gradio":"default: None"},{"gradio":"default value. If callable, the function will be called whenever the app loads to set the initial value of the component. Ignored if randomized=True."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"increment between slider values."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"additional component description."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"if True, slider will be adjustable; if False, adjusting will be disabled. If not provided, this is inferred based on whether the component is used as an input or output."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, the value of the slider when the app loads is taken uniformly at random from the range given by the minimum and maximum."},{"gradio":"gradio.Slider"},{"gradio":"\"slider\""},{"gradio":"This method can be used to change the appearance of the slider."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the component in a container - providing some extra padding around the border."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user releases the mouse on this component (e.g. when the user releases the slider). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Slider"},{"gradio":"Loading..."},{"gradio":"Special hidden component that stores session state across runs of the demo by the same user. The value of the State variable is cleared when the user refreshes the page."},{"gradio":"As input: No preprocessing is performed"},{"gradio":"As output: No postprocessing is performed"},{"gradio":"Any"},{"gradio":"default: None"},{"gradio":"the initial value of the state. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"No guides yet, contribute a guide about State"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"Loading..."},{"gradio":"Creates a textarea for user to enter string input or display string output."},{"gradio":"As input: passes textarea value as a str into the function."},{"gradio":"As output: expects a str returned from function and sets textarea value to it."},{"gradio":"Format expected for examples: a str representing the textbox input."},{"gradio":"str | Callable | None"},{"gradio":"default: \"\""},{"gradio":"default text to provide in textarea. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"int"},{"gradio":"default: 1"},{"gradio":"minimum number of line rows to provide in textarea."},{"gradio":"int"},{"gradio":"default: 20"},{"gradio":"maximum number of line rows to provide in textarea."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"placeholder hint to provide behind textarea."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"additional component description."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"str"},{"gradio":"default: \"text\""},{"gradio":"The type of textbox. One of: 'text', 'password', 'email', Default is 'text'."},{"gradio":"gradio.Textbox"},{"gradio":"\"textbox\""},{"gradio":"gradio.TextArea"},{"gradio":"\"textarea\""},{"gradio":"This method can be used to change the appearance of the component."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the component in a container - providing some extra padding around the border."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user presses the Enter key while the component (e.g. a textbox) is focused. This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the component's is unfocused/blurred (e.g. when the user clicks outside of a textbox). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"Event listener for when the user selects text in the Textbox. Uses event data gradio.SelectData to carry `value` referring to selected subtring, and `index` tuple referring to selected range endpoints. See EventData documentation on how to use this event data."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Textbox"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Creates a component that can be used to upload/preview timeseries csv files or display a dataframe consisting of a time series graphically."},{"gradio":"As input: passes the uploaded timeseries data as a pandas.DataFrame into the function"},{"gradio":"As output: expects a pandas.DataFrame or str path to a csv to be returned, which is then displayed as a timeseries graph"},{"gradio":"Format expected for examples: a str filepath of csv data with time series data."},{"gradio":"str | Callable | None"},{"gradio":"default: None"},{"gradio":"File path for the timeseries csv file. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Column name of x (time) series. None if csv has no headers, in which case first column is x series."},{"gradio":"str | List[str] | None"},{"gradio":"default: None"},{"gradio":"Column name of y series, or list of column names if multiple series. None if csv has no headers, in which case every column after first is a y series."},{"gradio":"List[str] | None"},{"gradio":"default: None"},{"gradio":"an ordered list of colors to use for each line plot"},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"if True, will allow users to upload a timeseries csv; if False, can only be used to display timeseries data. If not provided, this is inferred based on whether the component is used as an input or output."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"gradio.Timeseries"},{"gradio":"\"timeseries\""},{"gradio":"This method can be used to change the appearance of the TimeSeries component."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Timeseries"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Used to create an upload button, when cicked allows a user to upload files that satisfy the specified file type or generic files (if file_type not set)."},{"gradio":"As input: passes the uploaded file as a file-object or List[file-object] depending on `file_count` (or a bytes/Listbytes depending on `type`)"},{"gradio":"As output: expects function to return a str path to a file, or List[str] consisting of paths to files."},{"gradio":"Format expected for examples: a str path to a local file that populates the component."},{"gradio":"str"},{"gradio":"default: \"Upload a File\""},{"gradio":"Text to display on the button. Defaults to \"Upload a File\"."},{"gradio":"str | List[str] | Callable | None"},{"gradio":"default: None"},{"gradio":"Default text for the button to display."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"str"},{"gradio":"default: \"file\""},{"gradio":"Type of value to be returned by component. \"file\" returns a temporary file object with the same base name as the uploaded file, whose full path can be retrieved by file_obj.name, \"binary\" returns an bytes object."},{"gradio":"str"},{"gradio":"default: \"single\""},{"gradio":"if single, allows user to upload one file. If \"multiple\", user uploads multiple files. If \"directory\", user uploads all files in selected directory. Return type will be list for each file in case of \"multiple\" or \"directory\"."},{"gradio":"List[str] | None"},{"gradio":"default: None"},{"gradio":"List of type of files to be uploaded. \"file\" allows any file to be uploaded, \"image\" allows only image files to be uploaded, \"audio\" allows only audio files to be uploaded, \"video\" allows only video files to be uploaded, \"text\" allows only text files to be uploaded."},{"gradio":"gradio.UploadButton"},{"gradio":"\"uploadbutton\""},{"gradio":"This method can be used to change the appearance of the button component."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will expand to fill parent container."},{"gradio":"Literal['sm'] | Literal['lg'] | None"},{"gradio":"default: None"},{"gradio":"Size of the button. Can be \"sm\" or \"lg\"."},{"gradio":"This event is triggered when the component (e.g. a button) is clicked. This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user uploads a file into the component (e.g. when the user uploads a video into a video component). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about UploadButton"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Creates a video component that can be used to upload/record videos (as an input) or display videos (as an output). For the video to be playable in the browser it must have a compatible container and codec combination. Allowed combinations are .mp4 with h264 codec, .ogg with theora codec, and .webm with vp9 codec. If the component detects that the output video would not be playable in the browser it will attempt to convert it to a playable mp4 video. If the conversion fails, the original video is returned."},{"gradio":"As input: passes the uploaded video as a str filepath or URL whose extension can be modified by `format`."},{"gradio":"As output: expects a str filepath to a video which is displayed."},{"gradio":"Format expected for examples: a str filepath to a local file that contains the video."},{"gradio":"str | Callable | None"},{"gradio":"default: None"},{"gradio":"A path or URL for the default value that Video component is going to take. If callable, the function will be called whenever the app loads to set the initial value of the component."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Format of video format to be returned by component, such as 'avi' or 'mp4'. Use 'mp4' to ensure browser playability. If set to None, video will keep uploaded format."},{"gradio":"str"},{"gradio":"default: \"upload\""},{"gradio":"Source of video. \"upload\" creates a box where user can drop an video file, \"webcam\" allows user to record a video from their webcam."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"component name in interface."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, will display label."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"if True, will allow users to upload a video; if False, can only be used to display videos. If not provided, this is inferred based on whether the component is used as an input or output."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, component will be hidden."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If True webcam will be mirrored. Default is True."},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"Whether the component should record/retain the audio track for a video. By default, audio is excluded for webcam videos and included for uploaded videos."},{"gradio":"gradio.Video"},{"gradio":"\"video\""},{"gradio":"gradio.PlayableVideo"},{"gradio":"\"playablevideo\""},{"gradio":"This method can be used to change the appearance of the video component."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"Height of the video."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"Width of the video."},{"gradio":"This event is triggered when the component's input value changes (e.g. when the user types in a textbox or uploads an image). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user clears the component (e.g. image or audio) using the X button for the component. This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user plays the component (e.g. audio or video). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user pauses the component (e.g. audio or video). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user stops the component (e.g. audio or video). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"This event is triggered when the user uploads a file into the component (e.g. when the user uploads a video into a video component). This method can be used when this component is in a Gradio Blocks."},{"gradio":"Callable | None"},{"gradio":"required"},{"gradio":"the function to wrap an interface around. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component."},{"gradio":"Component | List[Component] | Set[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list."},{"gradio":"Component | List[Component] | None"},{"gradio":"default: None"},{"gradio":"List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Defining this parameter exposes the endpoint in the api docs"},{"gradio":"StatusTracker | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, will scroll to output component on completion"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will show progress animation while pending"},{"gradio":"bool | None"},{"gradio":"default: None"},{"gradio":"If True, will place the request on the queue, if the queue exists"},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component."},{"gradio":"int"},{"gradio":"default: 4"},{"gradio":"Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)"},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component)."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"If False, will not run postprocessing of component data before returning 'fn' output to the browser."},{"gradio":"Dict[str, Any] | List[Dict[str, Any]] | None"},{"gradio":"default: None"},{"gradio":"A list of other events to cancel when this event is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method."},{"gradio":"float | None"},{"gradio":"default: None"},{"gradio":"Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled."},{"gradio":"No guides yet, contribute a guide about Video"},{"gradio":"Gradio includes helper classes and methods that interact with existing components. The goal of these classes and methods is to help you add common functionality to your app without having to rewrite common functions."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"This class is a wrapper over the Dataset component and can be used to create Examples for Blocks / Interfaces. Populates the Dataset component with examples and assigns event listener so that clicking on an example populates the input/output components. Optionally handles example caching for fast inference."},{"gradio":"List[Any] | List[List[Any]] | str"},{"gradio":"required"},{"gradio":"example inputs that can be clicked to populate specific components. Should be nested list, in which the outer list consists of samples and each inner list consists of an input corresponding to each input component. A string path to a directory of examples can also be provided but it should be within the directory with the python file running the gradio app. If there are multiple input components and a directory is provided, a log.csv file must be present in the directory to link corresponding inputs."},{"gradio":"IOComponent | List[IOComponent]"},{"gradio":"required"},{"gradio":"the component or list of components corresponding to the examples"},{"gradio":"IOComponent | List[IOComponent] | None"},{"gradio":"default: None"},{"gradio":"optionally, provide the component or list of components corresponding to the output of the examples. Required if `cache` is True."},{"gradio":"Callable | None"},{"gradio":"default: None"},{"gradio":"optionally, provide the function to run to generate the outputs corresponding to the examples. Required if `cache` is True."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"if True, caches examples for fast runtime. If True, then `fn` and `outputs` need to be provided"},{"gradio":"int"},{"gradio":"default: 10"},{"gradio":"how many examples to show per page."},{"gradio":"str | None"},{"gradio":"default: \"Examples\""},{"gradio":"the label to use for the examples component (by default, \"Examples\")"},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"an optional string that is assigned as the id of this component in the HTML DOM."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"if cache_examples is False, clicking on an example does not run the function when an example is clicked. Set this to True to run the function when an example is clicked. Has no effect if cache_examples is True."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, preprocesses the example input before running the prediction function and caching the output. Only applies if cache_examples is True."},{"gradio":"bool"},{"gradio":"default: True"},{"gradio":"if True, postprocesses the example output after running the prediction function and before caching. Only applies if cache_examples is True."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. Used only if cache_examples is True."},{"gradio":"No guides yet, contribute a guide about Examples"},{"gradio":"Loading..."},{"gradio":"This space is experiencing an issue."},{"gradio":"Please contact the author of the space to let them know."},{"gradio":"The Progress class provides a custom progress tracker that is used in a function signature. To attach a Progress tracker to a function, simply add a parameter right after the input parameters that has a default value set to a `gradio.Progress()` instance. The Progress tracker can then be updated in the function by calling the Progress object or using the `tqdm` method on an Iterable. The Progress tracker is currently only available with `queue()`."},{"gradio":"bool"},{"gradio":"default: False"},{"gradio":"If True, the Progress object will track any tqdm.tqdm iterations with the tqdm library in the function."},{"gradio":"Updates progress tracker with progress and message text."},{"gradio":"float | Tuple[int, int | None] | None"},{"gradio":"required"},{"gradio":"If float, should be between 0 and 1 representing completion. If Tuple, first number represents steps completed, and second value represents total steps or None if unknown. If None, hides progress bar."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"description to display."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"estimated total number of steps."},{"gradio":"str"},{"gradio":"default: \"steps\""},{"gradio":"unit of iterations."},{"gradio":"Attaches progress tracker to iterable, like tqdm."},{"gradio":"Iterable | None"},{"gradio":"required"},{"gradio":"iterable to attach progress tracker to."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"description to display."},{"gradio":"int | None"},{"gradio":"default: None"},{"gradio":"estimated total number of steps."},{"gradio":"str"},{"gradio":"default: \"steps\""},{"gradio":"unit of iterations."},{"gradio":null},{"gradio":"required"},{"gradio":null},{"gradio":"No guides yet, contribute a guide about Progress"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"Updates component properties. When a function passed into a Gradio Interface or a Blocks events returns a typical value, it updates the value of the output component. But it is also possible to update the properties of an output component (such as the number of lines of a `Textbox` or the visibility of an `Image`) by returning the component's `update()` function, which takes as parameters any of the constructor parameters for that component. This is a shorthand for using the update method on a component. For example, rather than using gr.Number.update(...) you can just use gr.update(...). Note that your editor's autocompletion will suggest proper parameters if you use the update method on the component."},{"gradio":null},{"gradio":"required"},{"gradio":"Key-word arguments used to update the component's properties."},{"gradio":"No guides yet, contribute a guide about update"},{"gradio":"Generates a waveform video from an audio file. Useful for creating an easy to share audio visualization. The output should be passed into a `gr.Video` component."},{"gradio":"str | Tuple[int, np.ndarray]"},{"gradio":"required"},{"gradio":"Audio file path or tuple of (sample_rate, audio_data)"},{"gradio":"str"},{"gradio":"default: \"#f3f4f6\""},{"gradio":"Background color of waveform (ignored if bg_image is provided)"},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"Background image of waveform"},{"gradio":"float"},{"gradio":"default: 0.75"},{"gradio":"Opacity of foreground waveform"},{"gradio":"str | Tuple[str, str]"},{"gradio":"default: ('#fbbf24', '#ea580c')"},{"gradio":"Color of waveform bars. Can be a single color or a tuple of (start_color, end_color) of gradient"},{"gradio":"int"},{"gradio":"default: 50"},{"gradio":"Number of bars in waveform"},{"gradio":"float"},{"gradio":"default: 0.6"},{"gradio":"Width of bars in waveform. 1 represents full width, 0.5 represents half width, etc."},{"gradio":"No guides yet, contribute a guide about make_waveform"},{"gradio":"Loading..."},{"gradio":"Loading..."},{"gradio":"When a subclass of EventData is added as a type hint to an argument of an event listener method, this object will be passed as that argument. It contains information about the event that triggered the listener, such the target object, and other data related to the specific event that are attributes of the subclass."},{"gradio":"Block | None"},{"gradio":"required"},{"gradio":"The target object that triggered the event. Can be used to distinguish if multiple components are bound to the same listener."},{"gradio":"No guides yet, contribute a guide about EventData"},{"gradio":"Gradio includes some helper functions for exposing and interacting with the FastAPI app used to run your demo."},{"gradio":"A Gradio request object that can be used to access the request headers, cookies, query parameters and other information about the request from within the prediction function. The class is a thin wrapper around the fastapi.Request class. Attributes of this class include: `headers`, `client`, `query_params`, and `path_params`. If auth is enabled, the `username` attribute can be used to get the logged in user."},{"gradio":"fastapi.Request | None"},{"gradio":"default: None"},{"gradio":"A fastapi.Request"},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":null},{"gradio":"Mount a gradio.Blocks to an existing FastAPI application."},{"gradio":"fastapi.FastAPI"},{"gradio":"required"},{"gradio":"The parent FastAPI application."},{"gradio":"gradio.Blocks"},{"gradio":"required"},{"gradio":"The blocks object we want to mount to the parent app."},{"gradio":"str"},{"gradio":"required"},{"gradio":"The path at which the gradio application will be mounted."},{"gradio":"str | None"},{"gradio":"default: None"},{"gradio":"The full url at which the gradio app will run. This is only needed if deploying to Huggingface spaces of if the websocket endpoints of your deployed app are on a different network location than the gradio app. If deploying to spaces, set gradio_api_url to 'http://localhost:7860/'"}]