- Basic Skeleton App configured with
openai
API - A ChatBot using embedchain and Streamlit
- Docker Support with Optimisation Cache etc
- Deployment on Streamlit Public Cloud
This repo contains an main.py
file which has a template for a chatbot implementation.
Select the number of Data Sources from slider and enter the details.
Source | URL |
---|---|
youtube | https://www.youtube.com/watch?v=3qHkcs3kG44 |
pdf_file | https://navalmanack.s3.amazonaws.com/Eric-Jorgenson_The-Almanack-of-Naval-Ravikant_Final.pdf |
web | https://nav.al/feedback |
qna_pair | "Who is Naval Ravikant?", "Naval Ravikant is an Indian-American entrepreneur and investor." |
Question: What unique capacity does Naval argue humans possess when it comes to understanding explanations or concepts?
To add your chain, you need to change the load_chain
function in main.py
.
Depending on the type of your chain, you may also need to change the inputs/outputs that occur later on.
- Clone the repository📂
git clone https://github.com/amjadraza/embedchain-streamlit-app.git
- Install dependencies with Poetry and activate virtual environment🔨
poetry install
poetry shell
- Run the Streamlit server🚀
streamlit run demo_app/main.py
This project includes Dockerfile
to run the app in Docker container. In order to optimise the Docker Image
size and building time with cache techniques, I have follow tricks in below Article
https://medium.com/@albertazzir/blazing-fast-python-docker-builds-with-poetry-a78a66f5aed0
Build the docker container
docker build . -t embedchain-streamlit-app:latest
To generate Image with DOCKER_BUILDKIT
, follow below command
DOCKER_BUILDKIT=1 docker build --target=runtime . -t embedchain-streamlit-app:latest
- Run the docker container directly
docker run -d --name embedchain-streamlit-app -p 8080:8080 embedchain-streamlit-app:latest
- Run the docker container using docker-compose (Recommended)
docker-compose up
This app can be deployed on Streamlit Public Cloud using GitHub. Below is the Link to Publicly deployed App
https://embedchain.streamlit.app/
As embedchain-streamlit-app:latest
is a template project with minimal example. Report issues if you face any.
This is a template App, when using with openai_api key, you will be charged a nominal fee depending on number of prompts etc.