Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:ContextualAI HALOs Install Sh

From Leeroopedia


Knowledge Sources
Domains Infrastructure, DevOps
Last Updated 2026-02-08 03:00 GMT

Overview

Concrete tool for provisioning the HALOs training environment provided by a shell script.

Description

The install.sh script creates a conda environment named halos with Python 3.10.14 and installs all dependencies required for LLM alignment training, sampling, labeling, and evaluation. It pins exact versions of PyTorch (2.4.0), Flash Attention (2.6.3), Transformers (4.51.3), PEFT (0.12.0), Datasets (2.20.0), Accelerate (0.33.0), and vLLM (0.6.3.post1). It also clones the LM Evaluation Harness and pre-downloads evaluation tasks.

Usage

Run this script on a fresh machine with conda and CUDA 12.1 installed, before executing any training or evaluation workflow.

Code Reference

Source Location

Signature

#!/bin/bash

conda create --name halos python=3.10.14
conda activate halos

conda install pip
pip install packaging ninja
conda install pytorch=2.4.0 pytorch-cuda=12.1 -c pytorch -c nvidia
pip install flash-attn==2.6.3 --no-build-isolation
pip install transformers==4.51.3
pip install peft==0.12.0
pip install datasets==2.20.0
pip install accelerate==0.33.0
pip install vllm==0.6.3.post1
pip install alpaca-eval immutabledict langdetect wandb omegaconf openai hydra-core==1.3.2

# lm-eval
git clone --depth 1 https://github.com/EleutherAI/lm-evaluation-harness
cd lm-evaluation-harness
pip install -e .
# download tasks for offline eval
python << EOF
from lm_eval import tasks
task_names = ["winogrande", "mmlu", "gsm8k_cot", "bbh_cot_fewshot", "arc_easy", "arc_challenge", "hellaswag", "ifeval"]
task_dict = tasks.get_task_dict(task_names)

from datasets import load_dataset
load_dataset("tatsu-lab/alpaca_eval", "alpaca_eval")
EOF

Import

bash install.sh

I/O Contract

Inputs

Name Type Required Description
Machine Hardware Yes Fresh machine with conda and CUDA 12.1 installed
Network Connectivity Yes Internet access for downloading packages and datasets

Outputs

Name Type Description
halos environment conda env Activated Python 3.10.14 environment with all dependencies
lm-evaluation-harness Git repo Cloned and installed evaluation framework
Cached tasks Files Pre-downloaded benchmark task configs and AlpacaEval dataset

Usage Examples

Standard Installation

# Run from the repository root
bash install.sh

# Verify the environment is active
conda activate halos
python -c "import transformers; print(transformers.__version__)"
# Should print: 4.51.3

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment