Download scripts/benchmark_quant.sh from vedatonuryilmaz/deepgenopix: direct link, hf CLI and curl.
- Browser
- Download file 1.62 kB
-
https://huggingface.co/vedatonuryilmaz/deepgenopix/resolve/main/scripts/benchmark_quant.sh
- Command line
-
hf download hf://vedatonuryilmaz/deepgenopix/scripts/benchmark_quant.sh
-
curl -L -o benchmark_quant.sh https://huggingface.co/vedatonuryilmaz/deepgenopix/resolve/main/scripts/benchmark_quant.sh
1.62 kB
| set -euo pipefail | |
| ENCODER="${ENCODER:?must be set}" | |
| SWEEP_NAME="${1:?usage: $0 <sweep-name>}" | |
| REPO_URL="${REPO_URL:-https://github.com/vedatonuryilmaz/dev_genopix.git}" | |
| REPO_BRANCH="${REPO_BRANCH:-ml-intern}" | |
| DATA_DATASET="${DATA_DATASET:-vedatonuryilmaz/te-quant-benchmark-v1}" | |
| TOOLS="${TOOLS:-snk_em,snk_ot,vis_em,rsem,salmon}" | |
| SAMPLES_PER_SETTING="${SAMPLES_PER_SETTING:-4}" | |
| DEVICE="${DEVICE:-cpu}" | |
| git clone --branch "$REPO_BRANCH" --depth 1 "$REPO_URL" deepgenopix | |
| cd deepgenopix | |
| uv sync --extra hf --extra quant | |
| OUTPUT_DIR="data/output/quant_benchmark/$SWEEP_NAME" | |
| mkdir -p "$OUTPUT_DIR" | |
| uv run python -c " | |
| import json | |
| from pathlib import Path | |
| from deepgenopix.quant import SyntheticConfig, load_quant_encoder | |
| from deepgenopix.quant.synthetic import run_calibration_benchmark | |
| encoder = load_quant_encoder('$ENCODER', device='$DEVICE') | |
| tools = tuple(item.strip() for item in '$TOOLS'.split(',') if item.strip()) | |
| df = run_calibration_benchmark( | |
| encoder, | |
| SyntheticConfig(), | |
| tools=tools, | |
| samples_per_setting=int('$SAMPLES_PER_SETTING'), | |
| ) | |
| out = Path('$OUTPUT_DIR') | |
| df.to_parquet(out / 'results.parquet', index=False) | |
| df.to_csv(out / 'results.csv', index=False) | |
| (out / 'summary.json').write_text(json.dumps({ | |
| 'encoder': '$ENCODER', | |
| 'tools': tools, | |
| 'rows': int(len(df)), | |
| 'sweep_name': '$SWEEP_NAME', | |
| }, indent=2)) | |
| print(json.dumps({'rows': int(len(df)), 'output': str(out)})) | |
| " | |
| uv run python scripts/hf_artifacts.py push-dataset-folder \ | |
| --repo "$DATA_DATASET" \ | |
| --source "$OUTPUT_DIR" \ | |
| --path-in-repo "$SWEEP_NAME" \ | |
| --message "quant benchmark $SWEEP_NAME" | |