#!/bin/bash
col="$1"
hf jobs run -d --flavor a10g-small --timeout 4h --secrets HF_TOKEN \
  ghcr.io/huggingface/text-embeddings-inference:86-latest \
  bash -c 'set -e
curl -LsSf https://astral.sh/uv/install.sh | sh > /dev/null 2>&1
export PATH="$HOME/.local/bin:$PATH"
uv venv /tmp/venv --python 3.12 > /dev/null
uv pip install -q --python /tmp/venv/bin/python "saturate[hf]>=0.1.2"
curl -sL -H "Authorization: Bearer $HF_TOKEN" https://huggingface.co/datasets/davanstrien/jobpipe-staging/resolve/main/prelinger_embed_column.py -o /tmp/run.py
/tmp/venv/bin/python /tmp/run.py --column '"$col"' --rank 0 --world 1'
