liveBook · Manning

Launch

As explained in Hugging Face in Action

launch is a Gradio method that starts a configured application and makes its interface available for interaction.

launch is the Gradio method that starts a configured application and makes its interface available for interaction. With Interface, it opens a local URL, commonly http://127.0.0.1:7860. section 10.1.1

Listing 10.1 A simple Gradio example
import gradio as gr

def my_chatbot(message):
    return "Hello, " + message

interface = gr.Interface(fn = my_chatbot,  #1
                         title = "Hello, Gradio!",  #2
                         inputs = "text",  #3
                         outputs = "text")  #4

interface.launch()

A minimal runnable application binds Interface to my_chatbot and finishes by calling interface.launch(). section 10.1.1

Configure launch and its surrounding application with these options and operating notes:

  • Set share=True to create a temporary public link; the running notebook kernel or Python process must remain active. section 10.1.5
  • Use launch() after defining components and events inside a Blocks context for a more customized chatbot interface. section 10.3
  • Shared links expire after 72 hours; Hugging Face Spaces provides a more persistent public-hosting route. section 10.1.5

How Hugging Face in Action covers it

How deep it goes
Explains the call, local URL, sharing behavior, runtime dependency, and Blocks placement without detailing the full launch API.
Examples
Uses a text chatbot, a local browser URL, a temporary shared link, and a Blocks-based chatbot interface.
What it assumes
Assumes a configured Gradio Interface or Blocks context and a running notebook kernel or Python application when sharing.
What you can do after
Operate/configure it to run Gradio applications locally, share them temporarily, or launch customized Blocks interfaces.
How it connects
Connects Interface, Blocks, chatbot UI, authentication, and Hugging Face Spaces.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Hugging Face in Action. The section links point to the parts of the book it draws on.