Run this model with HF Jobs
Run dllwa/gemma4-form-report-lora on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/dllwa/gemma4-form-report-lora. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/dllwa/gemma4-form-report-lora on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use dllwa/gemma4-form-report-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use dllwa/gemma4-form-report-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-4-31B-it") model = PeftModel.from_pretrained(base_model, "dllwa/gemma4-form-report-lora") - Notebooks
- Google Colab
- Kaggle
Download code/scripts/server/run_train31b_form.sh from dllwa/gemma4-form-report-lora: direct link, hf CLI and curl.
- Browser
- Download file 3.35 kB
-
https://huggingface.co/dllwa/gemma4-form-report-lora/resolve/main/code/scripts/server/run_train31b_form.sh
- Command line
-
hf download hf://dllwa/gemma4-form-report-lora/code/scripts/server/run_train31b_form.sh
-
curl -L -o run_train31b_form.sh https://huggingface.co/dllwa/gemma4-form-report-lora/resolve/main/code/scripts/server/run_train31b_form.sh
3.35 kB
| # ๋ชฉํ 1 โ Gemma 4 31B ๋ก 11์ฐจ ๋ฐ์ดํฐยท๋ ์ํผ ์ฌํ์ต (2026-11-24, ์ฌ์ฉ์ ์ง์ "31B ์ฌ๋ฆฌ๊ณ ๋ก๋ผํ๋ ์งํ, ํ ์คํธ 3๊ฐ๋ง"). | |
| # ๋ฐ์ดํฐยท๋ ์ํผ๋ 11์ฐจ(scripts/server/run_train11.sh)์ ๊ฐ๋ค โ pairs10_train 8,296 ยท r16ยทฮฑ32 ยท lr 2e-4 ยท max_len 1536 ยท batch 2ร4 ยท seed 42. | |
| # ๋ค๋ฅธ ์ : base 31B ยท 2์ํญ ์ผ์ (11์ฐจ๋ 3์ํญ ์ผ์ ์์ 2์ํญ ์ง์ ์ฑํ โ cosine ๊ฐ์ ๊ฐ ๋ค๋ฅด๋ค) ยท device_map auto(๋ ์ฅ์ ์ธต ๋ถํ , ์์ฐจ ์คํ) | |
| # ยท mem_fraction 0.32(โ44.7 GiB/์ฅ โ GPU1 ์ฌ์ ๊ฐ rag-serving docling ๋๋ฌธ์ 48 GiB ๋ฟ์ด๋ผ ๋ ์ฅ ๊ณตํต ์ํ์ ๊ฑฐ๊ธฐ์ ๋ง์ถค). | |
| # ํ์ต ๋ค ํ ์คํธ 3๊ฑด(R02 ๊ดํธ๋ง ์ค๋ฌผ ๊ผด ยท R05 ๋ผ๋ฒจ ์ด๊ธ๋จ ยท R09 ํํ ๊ผด โ ์์ฑ ์ ์ง์ ) ์ 31B base ยท 31B LoRA ๋ก ์์ฑ. ์์ฑ ์กฐ๊ฑด์ ์ฌ์ธก์ ๊ณผ ๊ฐ๋ค. | |
| # ์์ธ์ ์คํ์ ์์ผ๋ก ๋ด๋ฆฐ ๋ค ๊ธฐ๋ํ๋ค(๋ฝ์ ์ฅ์ด burst ๋ ๋ผ์ด๋ค์ง ์์). | |
| # ๊ธฐ๋: setsid nohup bash scripts/server/run_train31b_form.sh >/dev/null 2>&1 & | |
| B=/home/work/data_resource | |
| cd $B/admin-llm || exit 1 | |
| M=$B/models/gemma-4-31B-it | |
| OUT=runs/exp_form31b | |
| ADA=runs/2026-11-24_D_form11_31b_r16_2ep | |
| DATA3=data/realdoc/probe_retest_1124_3.jsonl | |
| PY=$B/envs/lora/bin/python | |
| mkdir -p $OUT | |
| if [ "${1:-}" != "--locked" ]; then | |
| OURS=$(pgrep -f "^$PY" | xargs -r ps -o cmd= -p 2>/dev/null | grep -v "train_lora_vl" | grep -v "compile_worker" || true) | |
| if [ -n "$OURS" ]; then echo "์ฐ๋ฆฌ ๊ณ์ด ์ก ์์ โ ์ค๋จ: $OURS" >> $OUT/chain.log; exit 1; fi | |
| [ -f $M/model-00002-of-00002.safetensors ] && [ -f $DATA3 ] || { echo "๋ชจ๋ธยท์์ ์์" >> $OUT/chain.log; exit 1; } | |
| echo "WAIT_LOCK $(date '+%F %T')" >> $OUT/chain.log | |
| exec flock /tmp/lora_tune.lock bash "$0" --locked | |
| fi | |
| echo "LOCKED $(date '+%F %T')" >> $OUT/chain.log | |
| cp .commit_hash $OUT/commit_hash 2>/dev/null | |
| ok=0 | |
| for i in $(seq 60); do | |
| f0=$(nvidia-smi --query-gpu=memory.free --format=csv,noheader,nounits -i 0) | |
| f1=$(nvidia-smi --query-gpu=memory.free --format=csv,noheader,nounits -i 1) | |
| [ "$f0" -ge 47000 ] && [ "$f1" -ge 47000 ] && { ok=1; break; } | |
| sleep 10 | |
| done | |
| [ $ok -eq 1 ] || { echo "FAIL GPU ์ฌ์ ๋ถ์กฑ(GPU0 $f0 ยท GPU1 $f1 MiB)" >> $OUT/chain.log; exit 1; } | |
| export PYTHONPATH=$B/admin-llm/pyshim PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True | |
| echo "START_train $(date '+%F %T')" >> $OUT/chain.log | |
| $PY -u src/train/train_lora.py --model $M --task doc \ | |
| --train data/form10/pairs10_train.jsonl --val data/form10/pairs6_val.jsonl --val_max 237 \ | |
| --output $ADA --max_len 1536 --batch 2 --grad_accum 4 --lr 2e-4 --epochs 2 --per_epoch \ | |
| --mem_fraction 0.32 --device_map auto --seed 42 > $OUT/train.log 2>&1 \ | |
| || { echo "FAIL_train $(date '+%F %T')" >> $OUT/chain.log; exit 1; } | |
| echo "DONE_train $(date '+%F %T')" >> $OUT/chain.log | |
| CK=$(ls -d $ADA/checkpoint-* | sort -t- -k2 -n | tail -1) | |
| G="$PY -u src/eval/generate.py --model $M --seed 42 --repetition_penalty 1.0 --mem_fraction 0.32 --batch 3 --attn sdpa --max_prompt_len 4096 --max_new_tokens 1536 --stream --data $DATA3 --n 3" | |
| $G --out $OUT/base31.jsonl > $OUT/base31.log 2>&1 && echo "DONE_base31 $(date '+%F %T')" >> $OUT/chain.log | |
| $G --adapter $CK --out $OUT/lora31.jsonl > $OUT/lora31.log 2>&1 && echo "DONE_lora31 ($CK) $(date '+%F %T')" >> $OUT/chain.log | |
| echo "CHAIN_DONE $(date '+%F %T')" >> $OUT/chain.log | |