mirror of
https://github.com/gradio-app/gradio.git
synced 2025-04-06 12:30:29 +08:00
Add a section on how to run a Gradio app locally (#3170)
* Update 01_quickstart.md * Update CHANGELOG.md * Update 01_quickstart.md --------- Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
This commit is contained in:
parent
a4db6edd42
commit
dd5d7630be
@ -41,9 +41,9 @@ No changes to highlight.
|
||||
* Sort components in docs by alphabetic order by [@aliabd](https://github.com/aliabd) in [PR 3152](https://github.com/gradio-app/gradio/pull/3152)
|
||||
* Changes to W&B guide by [@scottire](https://github.com/scottire) in [PR 3153](https://github.com/gradio-app/gradio/pull/3153)
|
||||
* Keep pnginfo metadata for gallery by [@wfng92](https://github.com/wfng92) in [PR 3150](https://github.com/gradio-app/gradio/pull/3150)
|
||||
* Add a section on how to run a Gradio app locally [@osanseviero](https://github.com/osanseviero) in [PR 3170](https://github.com/gradio-app/gradio/pull/3170)
|
||||
* Fixed typos in gradio events function documentation by [@vidalmaxime](https://github.com/vidalmaxime) in [PR 3168](https://github.com/gradio-app/gradio/pull/3168)
|
||||
|
||||
|
||||
## Testing and Infrastructure Changes:
|
||||
No changes to highlight.
|
||||
|
||||
|
@ -26,6 +26,14 @@ $code_hello_world
|
||||
|
||||
$demo_hello_world
|
||||
|
||||
When developing locally, if you want to run the code as a Python script, you can use the Gradio CLI to launch the application **in reload mode**, which will provide seamless and fast development. Learn more about reloading in the [Auto-Reloading Guide](https://gradio.app/developing-faster-with-reload-mode/).
|
||||
|
||||
```bash
|
||||
gradio app.py
|
||||
```
|
||||
|
||||
Note: you can also do `python app.py`, but it won't provide the automatic reload mechanism.
|
||||
|
||||
## The `Interface` Class
|
||||
|
||||
You'll notice that in order to make the demo, we created a `gradio.Interface`. This `Interface` class can wrap any Python function with a user interface. In the example above, we saw a simple text-based function, but the function could be anything from music generator to a tax calculator to the prediction function of a pretrained machine learning model.
|
||||
|
Loading…
x
Reference in New Issue
Block a user