mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-17 11:29:58 +08:00
[doc] typos (#2373)
This commit is contained in:
parent
0df2c8dd3e
commit
91af580b85
@ -15,7 +15,7 @@ You can load a large dataset into the examples to browse and interact with the d
|
||||
|
||||
You wish to pass custom error messages to the user. To do so, raise a `gr.Error("custom message")` to display an error message. If you try to divide by zero in the the calculator demo above, a popup modal will display the custom error message.
|
||||
|
||||
## Decriptive Content
|
||||
## Descriptive Content
|
||||
|
||||
In the previous example, you may have noticed the `title=` and `description=` keyword arguments in the `Interface` constructor that helps users understand your app.
|
||||
|
||||
|
@ -10,7 +10,7 @@ $code_hello_blocks
|
||||
$demo_hello_blocks
|
||||
|
||||
- First, note the `with gr.Blocks() as demo:` clause. The Blocks app code will be contained within this clause.
|
||||
- Next come the Components. These are the same Components used in `Interface`. However, instead of being being passed to some constructor, Components are automatically added to the Blocks as they are created within the `with` clause.
|
||||
- Next come the Components. These are the same Components used in `Interface`. However, instead of being passed to some constructor, Components are automatically added to the Blocks as they are created within the `with` clause.
|
||||
- Finally, the `click()` event listener. Event listeners define the data flows within the app. In the example above, the listener ties the two Textboxes together. The Textbox `name` acts as the input and Textbox `output` acts as the output to the `greet` method. This dataflow is triggered when the Button `greet_btn` is clicked. Like an Interface, an event listener can take multiple inputs or outputs.
|
||||
|
||||
## Event Listeners and Interactivity
|
||||
|
@ -54,7 +54,7 @@ $demo_blocks_form
|
||||
|
||||
## Defining and Rendering Components Separately
|
||||
|
||||
In some cases, you might want to define components before you actually render them in your UI. For instance, you might want to show an examples section using `gr.Examples` above the corresponding `gr.Textbox` input. Since `gr.Examples` requires as a parameter the input component object, you will need to first define the input component, but then render it later, after you have definted the `gr.Examples` object.
|
||||
In some cases, you might want to define components before you actually render them in your UI. For instance, you might want to show an examples section using `gr.Examples` above the corresponding `gr.Textbox` input. Since `gr.Examples` requires as a parameter the input component object, you will need to first define the input component, but then render it later, after you have defined the `gr.Examples` object.
|
||||
|
||||
The solution to this is to define the `gr.Textbox` outside of the `gr.Blocks()` scope and use the component's `.render()` method wherever you'd like it placed in the UI.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user