Front-end with Streamlit
Now that we have seen the logic behind an LLM-powered recommendation system, it is now time to give a GUI to our MovieHarbor. To do so, we will once again leverage Streamlit, and we will assume the cold start scenario. As always, you can find the whole Python code in the GitHub book repository at https://github.com/PacktPublishing/Building-Large-Language-Model-Applications.As per the Globebotter application, also in this case you need to create a .py
file to run in your terminal via streamlit run file.py
. In our case, the file will be named movieharbor.py
.Below you can find the main steps to build the front end:
- Configuring the application webpage:
import streamlit as st
st.set_page_config(page_title="GlobeBotter", page_icon=" ")
st.header(' Welcome to MovieHarbor, your favourite movie recommender')
- Importing the credentials and establishing the connection towards LanceDB:
load_dotenv()
#os.environ["HUGGINGFACEHUB_API_TOKEN...