Custom Components GalleryNEW
ExploreCustom Components GalleryNEW
ExploreNew 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/661938e31f0d6b76eaed4cf086ee88ed37371c4a/gradio-4.32.2-py3-none-any.whl
*Note: Setting share=True
in
launch()
will not work.
gradio.Warning(ยทยทยท)
gr.Warning('message here')
in your function, and when that line is executed the custom message will appear in a modal on the demo. The modal is yellow by default and has the heading: "Warning." Queue must be enabled for this behavior; otherwise, the warning will be printed to the console using the warnings
library.import gradio as gr
def hello_world():
gr.Warning('This is a warning message.')
return "hello world"
with gr.Blocks() as demo:
md = gr.Markdown()
demo.load(hello_world, inputs=None, outputs=[md])
demo.queue().launch()
Parameter | Description |
---|---|
message str default: "Warning issued." | The warning message to be displayed to the user. |