-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·45 lines (41 loc) · 1.28 KB
/
Copy pathrun_tests.sh
File metadata and controls
executable file
·45 lines (41 loc) · 1.28 KB
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
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
export HF_ENDPOINT="${HF_ENDPOINT:-https://hf-mirror.com}"
export PYTORCH_CUDA_ALLOC_CONF="${PYTORCH_CUDA_ALLOC_CONF:-expandable_segments:True}"
export PYTHONDONTWRITEBYTECODE=1
if [[ "${DIFFSPEC_SKIP_CONDA:-0}" != "1" ]]; then
if command -v conda >/dev/null 2>&1; then
# shellcheck disable=SC1090
source "$(conda info --base)/etc/profile.d/conda.sh"
elif [[ -f "${HOME}/miniconda3/etc/profile.d/conda.sh" ]]; then
# shellcheck disable=SC1091
source "${HOME}/miniconda3/etc/profile.d/conda.sh"
else
echo "conda was not found. Set DIFFSPEC_SKIP_CONDA=1 to use the current Python environment." >&2
exit 1
fi
env_name="${DIFFSPEC_CONDA_ENV:-diffspec}"
if [[ -z "${DIFFSPEC_CONDA_ENV:-}" ]] && ! conda env list | awk '{print $1}' | grep -qx "$env_name"; then
env_name="eagle"
fi
conda activate "$env_name"
fi
case "${1:-unit}" in
unit)
python -m pytest tests -q
;;
smoke)
shift || true
./scripts/reproduce_llama31_8b.sh --preset smoke "$@"
;;
full)
shift || true
./scripts/reproduce_llama31_8b.sh --preset full "$@"
;;
*)
echo "Usage: $0 [unit|smoke|full] [extra reproduction args]" >&2
exit 2
;;
esac