Skip to content

Latest commit

 

History

History
74 lines (56 loc) · 1.78 KB

INSTALL.md

File metadata and controls

74 lines (56 loc) · 1.78 KB

Installation

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

On your machine

  1. Install Mambaforge
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh" && \
    bash Mambaforge-$(uname)-$(uname -m).sh
  1. Create and activate an environment
mamba create -n researcher python=3.10 -y
mamba activate researcher
  1. 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
  1. (Optional) For Jupyter Notebooks
mamba install jupyterlab ipykernel nbformat -y
  1. Running the app
PYTHONPATH=. streamlit run app/👋_Hello.py
# or
bash run.sh
  1. Open the app in your browser
http://localhost:8501

On a Docker Container

I provided a Dockerfile to build and run the app.

  1. Build the image
docker build . -t research-app:latest
  1. 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
  1. Open the app in your browser
http://localhost:8501