This is the tiny project that constructs the chatbot using by langchain and streamlit.
The data comes from a small part of pxmart 隔日達 https://pxbox.es.pxmart.com.tw/ and put in data/
folder.
Python version 3.9.13
Install the package
pip install -r requirements.txt
You need to create .env
in the root.
The .env
should be like
OPENAI_API_KEY = <your token>
HUGGINGFACEHUB_API_TOKEN = <your token>
USE_OPENAI_LLM = True
Must set the USE_OPENAI_LLM
to True or False. If you want to use huggingface embedding, recommend to use GPU.
Start backend (fastapi and langchain)
python app.py
Srart frontend (streamlit)
streamlit run frontend.py
We can use English to ask questions to chatbot althought the dataset is Chinese.
Another demo screenshot that shows I want to throw a barbecue party and ask the chatbot for the right ingredients.