git clone wherever you want to run this project from
python3 -m venv .venv # build your project virtual env
source .venv/bin/activate # activate your virual env
.venv/bin/python -m pip install --upgrade pip
.venv/bin/python -m pip install -r ./requirements.txt
Now you can activate and deactivate that specific python env and path like this:
user@host: source ./.venv/bin/activagte
user@host: deactivate
Do this every now and then! This uninstall/reinstalls all pip packages back to exactly what is in requirements.txt.
pip freeze | xargs pip uninstall -y
Make sure you have python path and OPENAPI_KEY in there, like this.
cat ./.env
PYTHONPATH=/Users/afraser/Documents/src/daacs-nlp/src:/Users/afraser/Documents/src/daacs-nlp/.venv/lib/python3.11/site-packages
OPENAI_API_KEY=sk-2r7jkiZZNSdJEBrZKnkuT3Blb*******STUFFGETYOUROWN*********
Should look about like this:
# ... stuff
VIRTUAL_ENV="/Users/afraser/Documents/src/daacs-nlp/.venv"
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
# ... enter it here, where other envs are set.
export PYTHONPATH=/Users/afraser/Documents/src/daacs-nlp/src:/Users/afraser/Documents/src/daacs-nlp/.venv/lib/python3.11/site-packages
##
- Create an HF account, and an organization for yourself
- Go to your hf account, click create token, make sure it's a write token, not just a read token
- In your shell, activate your virtual env
- In HF, go find the model, then fill out the form to gain access. Currently is this. : https://huggingface.co/meta-llama/Meta-Llama-Guard-2-8B You'll have to be approved, so you might have to wait a few hours.
- run
huggingface-cli login
and paste in your write token. - ALSO set your token as a shell variable, like this.
(.venv) hurricane:daacs-nlp afraser$ export HUGGINGFACE_TOKEN=hf_fdtykEqnsbhEF-GET-YOUR-OWNClfjMgDlHPHkLGnr
. Agin note the shell should be - Before you run
(.venv) hurricane:daacs-nlp afraser$ python ./src/daacs/runnable/build_vector_cache.py
you can test if you're set up correctly by running(.venv) hurricane:daacs-nlp afraser$ huggingface-cli 'download' "meta-llama/Meta-Llama-Guard-2-8B