hadikhamoud's picture
Archive Codabench blind-test submissions and vLLM inference artifacts
9953e4c verified
Raw
History Blame Contribute Delete
1.35 kB
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${ROOT}"
PYTHON_BIN="${PYTHON_BIN:-python3}"
if ! command -v "${PYTHON_BIN}" >/dev/null 2>&1; then
echo "Could not find ${PYTHON_BIN}."
exit 1
fi
"${PYTHON_BIN}" - <<'PY'
import sys
print("Python:", sys.version)
if sys.version_info < (3, 10) or sys.version_info >= (3, 13):
raise SystemExit("Use Python 3.10, 3.11, or 3.12.")
PY
if [[ ! -d .venv ]]; then
"${PYTHON_BIN}" -m venv .venv
else
echo "Reusing existing .venv."
fi
source .venv/bin/activate
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements.txt
python - <<'PY'
import huggingface_hub
import torch
import transformers
import vllm
for module in (torch, transformers, vllm, huggingface_hub):
print(module.__name__, getattr(module, "__version__", "unknown"))
print("CUDA available:", torch.cuda.is_available())
if torch.cuda.is_available():
print("GPU:", torch.cuda.get_device_name(0))
print("BF16 supported:", torch.cuda.is_bf16_supported())
PY
python -m py_compile type_predictor.py run_test.py
bash -n setup_env.sh
bash -n run_test.sh
echo
echo "Environment ready."
echo "Next:"
echo " cp .env.template .env"
echo " edit .env and set HF_TOKENONE"
echo " put test.jsonl at /workspace/test.jsonl"
echo " bash run_test.sh"