You have a watsonx instance on IBM Cloud, and the InstructLab installed and configured on your local machine.
cd code
python3 -m venv --upgrade-deps venv
source venv/bin/activate
python3 -m pip install requests
python3 -m pip install openpyxl
- Environment Variables
cat env_template > .env
- Content
# IBM Cloud
export IBMCLOUD_APIKEY=YOUR API KEY
export IBMCLOUD_URL="https://iam.cloud.ibm.com/identity/token"
# Watsonx
export WATSONX_URL="https://us-south.ml.cloud.ibm.com/ml/v1/text/generation"
export WATSONX_VERSION=2023-05-29
export WATSONX_PROJECT_ID=f158173c-d8d4-4eb5-b846-eff2365d4c56
export WATSONX_MIN_NEW_TOKENS=1
export WATSONX_MAX_NEW_TOKENS=300
export WATSONX_LLM_NAME=ibm/granite-13b-chat-v2
export WATSONX_PROMPT_FILE="$(pwd)/prompts/prompt-granite.txt"
# InstructLab
export INSTRUCTLAB_URL="http://127.0.0.1:8000/v1/completions"
export INSTRUCTLAB_PROMPT_FILE="$(pwd)/prompts/prompt-clean.txt"
export INSTRUCTLAB_MAX_NEW_TOKENS=300
sh run_wx_experiment.sh
You need to open two terminals.
- First terminal
export MODEL_PATH="YOUR_PATH/YOUR_MODEL.gguf"
cd instructlab
source ./venv/bin/activate
ilab model serve --model-path ${MODEL_PATH}
- Second terminal
sh run_instlab_experiment.sh