File size: 1,423 Bytes
9977290 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip wheel setuptools
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
python -m pip install -U \
numpy pandas pyarrow polars scipy scikit-learn \
tqdm pyyaml orjson jsonlines regex \
transformers accelerate bitsandbytes \
sentencepiece protobuf safetensors tokenizers \
huggingface_hub datasets peft sentence-transformers
python -m pip install -U faiss-cpu pyserini rank-bm25
python - <<'PY'
import sys
print("python:", sys.version)
import torch
print("torch:", torch.__version__)
print("cuda:", torch.version.cuda)
print("cuda available:", torch.cuda.is_available())
if torch.cuda.is_available():
print("gpu:", torch.cuda.get_device_name(0))
print("capability:", torch.cuda.get_device_capability(0))
print("memory GB:", torch.cuda.get_device_properties(0).total_memory / 1024**3)
print("bf16 supported:", torch.cuda.is_bf16_supported())
import transformers, accelerate
print("transformers:", transformers.__version__)
print("accelerate:", accelerate.__version__)
try:
import bitsandbytes as bnb
print("bitsandbytes:", bnb.__version__)
except Exception as e:
print("bitsandbytes import error:", type(e).__name__, e)
PY
echo "ML environment ready. Activate with: source .venv/bin/activate"
|