I've always ran into problems when installing from an environtment.yml. Specially, when running in a Docker container.
Therefore, here's a list of the steps I took to install the environment.
First let's clone the repository:
git clone git@github.com:stepp1/research-app.git
And create a .env
file that holds our API keys:
echo -e "HUGGINGFACEHUB_API_TOKEN = hf_...
OPENAI_API_KEY = sk-..." > .env
- Install Mambaforge
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh" && \
bash Mambaforge-$(uname)-$(uname -m).sh
- Create and activate an environment
mamba create -n researcher python=3.10 -y
mamba activate researcher
- Install the dependencies
mamba install python=3.10 pdfminer matplotlib scikit-learn pandas nltk plotly numpy sentence-transformers fuzzywuzzy umap-learn python-levenshtein pdf2image arxiv pytorch torchvision torchaudio pytorch-cuda=11.7 faiss -c pytorch-nightly -c nvidia -y
pip install streamlit google-search-results selenium selectolax selenium-stealth langchain "black[jupyter]" InstructorEmbedding python-dotenv
- (Optional) For Jupyter Notebooks
mamba install jupyterlab ipykernel nbformat -y
- Running the app
PYTHONPATH=. streamlit run app/👋_Hello.py
# or
bash run.sh
- Open the app in your browser
http://localhost:8501
I provided a Dockerfile to build and run the app.
- Build the image
docker build . -t research-app:latest
- Run the container and add the .env file
docker run --gpus all -i -v $(pwd)/.env:/app/.env -p 8501:8501 -t research-app:latest
- Open the app in your browser
http://localhost:8501