Merge pull request #755 from gradio-app/Update-Docs

Update The Docs on Launch
This commit is contained in:
Ömer Faruk Özdemir 2022-02-28 21:17:29 +03:00 committed by GitHub
commit faf55f2c9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View File

@ -11,5 +11,5 @@ iface = gr.Interface(
outputs="text",
)
if __name__ == "__main__":
app, path_to_local_server, share_url = iface.launch()
app, local_url, share_url = iface.launch()

View File

@ -14,5 +14,5 @@ iface = gr.Interface(
outputs=["text", "number"],
)
if __name__ == "__main__":
app, path_to_local_server, share_url = iface.launch()
iface.launch();

View File

@ -36,10 +36,11 @@ With these three arguments, we can quickly create interfaces and `launch()` th
Let's say we want to customize the input text field - for example, we wanted it to be larger and have a text hint. If we use the actual input class for `Textbox` instead of using the string shortcut, we have access to much more customizability. To see a list of all the components we support and how you can customize them, check out the [Docs](https://gradio.app/docs).
**Sidenote**: `launch()` method returns
- FastAPI application
- Local URL
- Public URL (if share=True)
**Sidenote**: `Interface.launch()` method returns 3 values:
1. `app`, which is the FastAPI application that is powering the Gradio demo
2. `local_url`, which is the local address of the server
3. `share_url`, which is the public address for this demo (it is generated if `share=True` more [on this later](https://gradio.app/getting_started/#sharing-interfaces-publicly))
{{ code["hello_world_2"] }}
{{ demos["hello_world_2"] }}