Introducing Gradio ClientsJoin us on Thursday, 9am PST
LivestreamIntroducing Gradio ClientsJoin us on Thursday, 9am PST
LivestreamNew to Gradio? Start here: Getting Started
See the Release History
To install Gradio from main, run the following command:
pip install https://gradio-builds.s3.amazonaws.com/7672b0a761088fb817b0f686cd3c333bd4a5cfed/gradio-4.36.1-py3-none-any.whl
*Note: Setting share=True
in
launch()
will not work.
raise gradio.Error("An error occured π₯!", duration=5)
duration
parameter. If itβs None
, the message will be displayed forever until the user closes it. If itβs a number, it will be shown for that many seconds.visible=False
.import gradio as gr
def divide(numerator, denominator):
if denominator == 0:
raise gr.Error("Cannot divide by zero!")
gr.Interface(divide, ["number", "number"], "number").launch()
Parameter | Description |
---|---|
message str default: "Error raised." | The error message to be displayed to the user. |
duration float | None default: 10 | The duration in seconds to display the error message. If None or 0, the error message will be displayed until the user closes it. |
visible bool default: True | Whether the error message should be displayed in the UI. |