diff --git a/README.md b/README.md index dadeb014c3..c12d6b394c 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,20 @@ - +
gradio
to gr
for better readability of code. This is a widely adopted convention that you should follow so that anyone working with your code can easily understand it.
+ > We shorten the imported name from gradio
to gr
. This is a widely adopted convention for better readability of code.
-Now, run your code. If you've written the Python code in a file named, for example, `app.py`, then you would run `python app.py` from the terminal.
+Now, run your code. If you've written the Python code in a file named `app.py`, then you would run `python app.py` from the terminal.
The demo below will open in a browser on [http://localhost:7860](http://localhost:7860) if running from a file. If you are running within a notebook, the demo will appear embedded within the notebook.
@@ -93,7 +93,7 @@ The demo below will open in a browser on [http://localhost:7860](http://localhos
Type your name in the textbox on the left, drag the slider, and then press the Submit button. You should see a friendly greeting on the right.
> [!TIP]
- > When developing locally, you can run your Gradio app in hot reload mode, which automatically reloads the Gradio app whenever you make changes to the file. To do this, simply type in gradio
before the name of the file instead of python
. In the example above, you would type: `gradio app.py` in your terminal. Learn more about hot reloading in the Hot Reloading Guide.
+ > When developing locally, you can run your Gradio app in hot reload mode, which automatically reloads the Gradio app whenever you make changes to the file. To do this, simply type in gradio
before the name of the file instead of python
. In the example above, you would type: `gradio app.py` in your terminal. Learn more in the Hot Reloading Guide.
**Understanding the `Interface` Class**
@@ -108,7 +108,7 @@ The `Interface` class has three core arguments:
The `fn` argument is very flexible -- you can pass *any* Python function that you want to wrap with a UI. In the example above, we saw a relatively simple function, but the function could be anything from a music generator to a tax calculator to the prediction function of a pretrained machine learning model.
-The `input` and `output` arguments take one or more Gradio components. As we'll see, Gradio includes more than [30 built-in components](https://www.gradio.app/docs/gradio/introduction) (such as the `gr.Textbox()`, `gr.Image()`, and `gr.HTML()` components) that are designed for machine learning applications.
+The `inputs` and `outputs` arguments take one or more Gradio components. As we'll see, Gradio includes more than [30 built-in components](https://www.gradio.app/docs/gradio/introduction) (such as the `gr.Textbox()`, `gr.Image()`, and `gr.HTML()` components) that are designed for machine learning applications.
> [!TIP]
> For the `inputs` and `outputs` arguments, you can pass in the name of these components as a string (`"textbox"`) or an instance of the class (`gr.Textbox()`).
@@ -143,18 +143,17 @@ To learn more about sharing your demo, read our dedicated guide on [sharing your
### An Overview of Gradio
-So far, we've been discussing the `Interface` class, which is a high-level class that lets to build demos quickly with Gradio. But what else does Gradio do?
-
-#### Chatbots with `gr.ChatInterface`
-
-Gradio includes another high-level class, `gr.ChatInterface`, which is specifically designed to create Chatbot UIs. Similar to `Interface`, you supply a function and Gradio creates a fully working Chatbot UI. If you're interested in creating a chatbot, you can jump straight [our dedicated guide on `gr.ChatInterface`](https://www.gradio.app/guides/creating-a-chatbot-fast).
+So far, we've been discussing the `Interface` class, which is a high-level class that lets to build demos quickly with Gradio. But what else does Gradio include?
#### Custom Demos with `gr.Blocks`
-Gradio also offers a low-level approach for designing web apps with more flexible layouts and data flows with the `gr.Blocks` class. Blocks allows you to do things like control where components appear on the page, handle complex data flows (e.g. outputs can serve as inputs to other functions), and update properties/visibility of components based on user interaction β still all in Python.
+Gradio offers a low-level approach for designing web apps with more customizable layouts and data flows with the `gr.Blocks` class. Blocks supports things like controlling where components appear on the page, handling multiple data flows and more complex interactions (e.g. outputs can serve as inputs to other functions), and updating properties/visibility of components based on user interaction β still all in Python.
You can build very custom and complex applications using `gr.Blocks()`. For example, the popular image generation [Automatic1111 Web UI](https://github.com/AUTOMATIC1111/stable-diffusion-webui) is built using Gradio Blocks. We dive deeper into the `gr.Blocks` on our series on [building with Blocks](https://www.gradio.app/guides/blocks-and-event-listeners).
+#### Chatbots with `gr.ChatInterface`
+
+Gradio includes another high-level class, `gr.ChatInterface`, which is specifically designed to create Chatbot UIs. Similar to `Interface`, you supply a function and Gradio creates a fully working Chatbot UI. If you're interested in creating a chatbot, you can jump straight to [our dedicated guide on `gr.ChatInterface`](https://www.gradio.app/guides/creating-a-chatbot-fast).
#### The Gradio Python & JavaScript Ecosystem
@@ -167,7 +166,7 @@ That's the gist of the core `gradio` Python library, but Gradio is actually so m
### What's Next?
-Keep learning about Gradio sequentially using the Gradio Guides, which include explanations as well as example code and embedded interactive demos. Next up: [key features about Gradio demos](https://www.gradio.app/guides/key-features).
+Keep learning about Gradio sequentially using the Gradio Guides, which include explanations as well as example code and embedded interactive demos. Next up: [let's dive deeper into the Interface class](https://www.gradio.app/guides/the-interface-class).
Or, if you already know the basics and are looking for something specific, you can search the more [technical API documentation](https://www.gradio.app/docs/).
diff --git a/guides/01_getting-started/01_quickstart.md b/guides/01_getting-started/01_quickstart.md
index 4cc35cdc8a..72289d413e 100644
--- a/guides/01_getting-started/01_quickstart.md
+++ b/guides/01_getting-started/01_quickstart.md
@@ -1,10 +1,11 @@
# Quickstart
-Gradio is an open-source Python package that allows you to quickly **build a demo** or web application for your machine learning model, API, or any arbitrary Python function. You can then **share your demo** with a a public link in seconds using Gradio's built-in sharing features. *No JavaScript, CSS, or web hosting experience needed!*
+Gradio is an open-source Python package that allows you to quickly **build** a demo or web application for your machine learning model, API, or any arbitrary Python function. You can then **share** a link to your demo or web application in just a few seconds using Gradio's built-in sharing features. *No JavaScript, CSS, or web hosting experience needed!*
-
+
+
+It just takes a few lines of Python to create your own demo, so let's get started π«
-It just takes a few lines of Python to create a demo like the one above, so let's get started.
## Installation
@@ -14,11 +15,11 @@ It just takes a few lines of Python to create a demo like the one above, so let'
We recommend installing Gradio using `pip`, which is included by default in Python. Run this in your terminal or command prompt:
```bash
-pip install gradio
+pip install --upgrade gradio
```
-Tip: it is best to install Gradio in a virtual environment. Detailed installation instructions for all common operating systems are provided here.
+Tip: It is best to install Gradio in a virtual environment. Detailed installation instructions for all common operating systems are provided here.
## Building Your First Demo
@@ -85,7 +86,7 @@ Now, anyone around the world can try your Gradio demo from their browser, while
To learn more about sharing your demo, read our dedicated guide on [sharing your Gradio application](https://www.gradio.app/guides/sharing-your-app).
-## Core Gradio Classes
+## An Overview of Gradio
So far, we've been discussing the `Interface` class, which is a high-level class that lets to build demos quickly with Gradio. But what else does Gradio include?
@@ -101,7 +102,7 @@ Gradio includes another high-level class, `gr.ChatInterface`, which is specifica
### The Gradio Python & JavaScript Ecosystem
-That's the gist of the core `gradio` Python library, but Gradio is actually so much more! Its an entire ecosystem of Python and JavaScript libraries that let you build machine learning applications, or query them programmatically, in Python or JavaScript. Here are other related parts of the Gradio ecosystem:
+That's the gist of the core `gradio` Python library, but Gradio is actually so much more! It's an entire ecosystem of Python and JavaScript libraries that let you build machine learning applications, or query them programmatically, in Python or JavaScript. Here are other related parts of the Gradio ecosystem:
* [Gradio Python Client](https://www.gradio.app/guides/getting-started-with-the-python-client) (`gradio_client`): query any Gradio app programmatically in Python.
* [Gradio JavaScript Client](https://www.gradio.app/guides/getting-started-with-the-js-client) (`@gradio/client`): query any Gradio app programmatically in JavaScript.
diff --git a/readme_template.md b/readme_template.md
index aa1f31bcf8..dcc6f09951 100644
--- a/readme_template.md
+++ b/readme_template.md
@@ -1,10 +1,18 @@