Skip to content

Commit

Permalink
Fix quiz
Browse files Browse the repository at this point in the history
  • Loading branch information
lewtun committed Apr 5, 2022
1 parent 5aa10d4 commit 351c4f9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
1 change: 1 addition & 0 deletions chapters/en/_toctree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
title: Advanced features
- local: chapter9/7
title: End-of-chapter quiz
quiz: 9

- title: Hugging Face Course Event
sections:
Expand Down
44 changes: 23 additions & 21 deletions chapters/en/chapter9/7.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<!-- DISABLE-FRONTMATTER-SECTIONS -->

# End-of-chapter quiz

Let's test what you learned in this chapter!

### 1. What can you use Gradio to do?

<Question
hydrate-props={{ choices: [
choices={[
{
text: "Create a demo for your machine learning model",
explain: "With a few lines of python code you can generate a demo for your ML model using our library of pre-built components.",
Expand All @@ -25,13 +27,13 @@ Let's test what you learned in this chapter!
text: "Train your model",
explain: "Gradio is designed to be used for model inference, AFTER your model is trained.",
}
]}}
]}
/>

### 2. Gradio ONLY works with PyTorch models

<Question
hydrate-props={{ choices: [
choices={[
{
text: "True",
explain: "Gradio works with pytorch models, but also works for any type of machine learning model!"
Expand All @@ -40,14 +42,14 @@ Let's test what you learned in this chapter!
text: "False",
explain: "Gradio is model agnostic, meaning you can create a demo for any type of machine learning model.",
correct: true
}
]}}
}
]}
/>

### 3. Where can you launch a Gradio demo from?

<Question
hydrate-props={{ choices: [
choices={[
{
text: "Standard python IDEs",
explain: "Gradio works great with your favorite IDE.",
Expand All @@ -62,14 +64,14 @@ Let's test what you learned in this chapter!
text: "Jupyter notebooks",
explain: "Good choice - You can create and launch a demo within your Jupyter notebook.",
correct: true
}
]}}
}
]}
/>

### 4. Gradio is designed primarily for NLP models

<Question
hydrate-props={{ choices: [
choices={[
{
text: "True",
explain: "Gradio works with pretty much any data type, not just NLP."
Expand All @@ -79,13 +81,13 @@ Let's test what you learned in this chapter!
explain: "Gradio supplies developers with a library of pre-built components for pretty much all data types.",
correct: true
}
]}}
]}
/>

### 5. Which of the following features are supported by Gradio?

<Question
hydrate-props={{ choices: [
choices={[
{
text: "Multiple inputs and outputs",
explain: "Multiple inputs and outputs is possible with gradio. All you need to do is pass in a list of inputs and outputs to their corresponding parameters",
Expand All @@ -110,13 +112,13 @@ Let's test what you learned in this chapter!
explain: "Absolutely - load any Hugging Face model using the gr.Interface.load() method",
correct: true
}
]}}
]}
/>

### 6. Which of the following are valid ways of loading a Hugging Face model from Hub or Spaces?

<Question
hydrate-props={{ choices: [
choices={[
{
text: "gr.Interface.load('huggingface/{user}/{model_name}')",
explain: "This is a valid method of loading a Hugging Face model from the Hub",
Expand All @@ -136,13 +138,13 @@ Let's test what you learned in this chapter!
explain: "This is a valid method of loading a Hugging Face model from Spaces",
correct: true
}
]}}
]}
/>

### 7. Select all the steps necessary for adding state to your Gradio interface

<Question
hydrate-props={{ choices: [
choices={[
{
text: "Pass in an extra parameter into your prediction function, which represents the state of the interface.",
explain: "An extra parameter storing history or state of your interface is necessary.",
Expand All @@ -158,13 +160,13 @@ Let's test what you learned in this chapter!
explain: "Gradio provides a state input and output component to persist data.",
correct: true
}
]}}
]}
/>

### 8. Which of the following are components included in the Gradio library?
### 8. Which of the following are components included in the Gradio library?

<Question
hydrate-props={{ choices: [
choices={[
{
text: "Textbox.",
explain: "Yes, you can create textboxes with the Textbox component.",
Expand All @@ -184,13 +186,13 @@ Let's test what you learned in this chapter!
explain: "Yes, you can create an audio upload widget with the Audio component.",
correct: true
},
]}}
]}
/>

### 9. How long does a Gradio share link last?

<Question
hydrate-props={{ choices: [
choices={[
{
text: "1 hour",
explain: "It lasts longer than that!",
Expand All @@ -208,5 +210,5 @@ Let's test what you learned in this chapter!
explain: "It lasts 72 hours, as long as your device continues running!",
correct: true
},
]}}
]}
/>

0 comments on commit 351c4f9

Please sign in to comment.