In this step, you’ll set up a Python virtual environment and install the required dependencies for working with Llama.cpp. This ensures you have a clean, isolated Python environment with all the necessary packages for model optimization.
virtualenv env-llama-cpp
This command creates a new Python virtual environment named env-llama-cpp
, which has the following benefits:
Run the following command to activate the virtual environment:
source env-llama-cpp/bin/activate
This command does the following:
env-llama-cpp
, indicating the environment is activePATH
to use the environment’s Python interpreterpip
commands install packages into the isolated environmentBefore installing dependencies, it’s a good idea to upgrade pip:
pip install --upgrade pip
This command:
--upgrade
flag to fetch and install the newest releaseUse the following command to install all required Python packages:
pip install -r requirements.txt
This command does the following:
-r
flag to read the list of dependencies from requirements.txt
llama.cpp
This step sets up everything you need to run AFM-4.5B in your Python environment.
After the installation completes, your virtual environment includes:
Your environment is now ready to run Python scripts that integrate with the compiled Llama.cpp binaries.