Instructions to use srivassid/drishti with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use srivassid/drishti with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-4-12B-it") model = PeftModel.from_pretrained(base_model, "srivassid/drishti") - Notebooks
- Google Colab
- Kaggle
Download code/run_train.sh from srivassid/drishti: direct link, hf CLI and curl.
- Browser
- Download file 1.66 kB
-
https://huggingface.co/srivassid/drishti/resolve/main/code/run_train.sh
- Command line
-
hf download hf://srivassid/drishti/code/run_train.sh
-
curl -L -o run_train.sh https://huggingface.co/srivassid/drishti/resolve/main/code/run_train.sh
1.66 kB
| # Supervisor: remounts data, runs training, resumes from the newest checkpoint after crash/reboot. | |
| # Launch: nohup /mnt/hdd/vlmin/run_train.sh >> /mnt/hdd/vlmin/runs/supervisor.log 2>&1 & | |
| # Stops for good when runs/<RUN>.DONE exists. Safe to launch twice (flock). | |
| CFG=${CFG:-configs/train_gemma4_12b.yaml} | |
| RUN=${RUN:-gemma4-12b-indic-v2} | |
| LIMIT=${LIMIT:-36000} | |
| GPU=${GPU:-1,2} | |
| BS=${BS:-2} | |
| NGPU=$(echo $GPU | tr "," "\n" | wc -l) | |
| cd /mnt/hdd/vlmin/VLM-IN || exit 1 | |
| DONE=/mnt/hdd/vlmin/runs/$RUN.DONE | |
| LOCK=/mnt/hdd/vlmin/runs/$RUN.lock | |
| exec 9>"$LOCK"; flock -n 9 || { echo "$(date) already running"; exit 0; } | |
| [ -f "$DONE" ] && { echo "$(date) already finished"; exit 0; } | |
| export PYTHONPATH=$PWD/src CUDA_VISIBLE_DEVICES=$GPU TOKENIZERS_PARALLELISM=false | |
| for try in $(seq 1 50); do | |
| if ! ls ~/data50/VLM-IN >/dev/null 2>&1; then | |
| fusermount -uz ~/data50 2>/dev/null | |
| mkdir -p ~/data50 | |
| sshfs -o ro,IdentityFile=$HOME/.ssh/id_to50,reconnect,ServerAliveInterval=15,cache=yes,kernel_cache,StrictHostKeyChecking=accept-new administrator@192.168.29.50:/F:/Data ~/data50 | |
| fi | |
| if ls ~/data50/VLM-IN/processed/mix/train.jsonl >/dev/null 2>&1; then | |
| echo "$(date) start attempt $try" | |
| ../venv/bin/torchrun --nproc_per_node=$NGPU --master_port=29511 -m vlmin.train --config $CFG --run-name $RUN --train-limit $LIMIT --set train.save_steps=50 --set train.per_device_train_batch_size=$BS --set train.gradient_accumulation_steps=$((16/NGPU/BS)) >> /mnt/hdd/vlmin/runs/$RUN.log 2>&1 | |
| rc=$? | |
| echo "$(date) exit $rc" | |
| [ $rc -eq 0 ] && { touch "$DONE"; exit 0; } | |
| else | |
| echo "$(date) data not reachable, retry" | |
| fi | |
| sleep 120 | |
| done | |