In this lab, you will work with Hugging Face and Gradio web applications to modify a Hello World app, run a summarization app, explore customizing summarization applications, and build a command-line tool using the click framework.
By the end of this lab, you will:
- Understand the benefits of using web frameworks like Gradio for machine learning solutions.
- Learn how to modify and work with Hugging Face and Gradio applications.
- Gain experience in building command-line tools using the click framework.
-
Run the following Hugging Face and Gradio web application
helloApp
by using:python helloApp.py
. -
Change this application to be a calculator that adds two numbers using the calculator function in
mylib
, i.e.,from mylib.calculator import add
.
Reflection Question: Why does a web framework like Gradio help build machine learning solutions faster?
- Run the
summarizeApp.py
by usingpython summarizeApp.py
and type in some of the text found intext.txt
. Preview it by pasting the URL into the web preview tool.
Reflection Question: How does the prediction change when you type more or less of the document?
- Run
load_model.py
to see a full example of how to customize summarization applications.
- Build a command-line tool that is similar in functionality to the Gradio app using the click framework.