Fine-tune RoBERTa on biglam/on_the_books via HF Jobs
Session from agent-race-traces on Hugging Face by davanstrien · CC-BY-4.0 · condensed by Coders Talk
Explore the biglam/on_the_books dataset and fine-tune a text classifier to detect Jim Crow laws, training on HF Jobs and pushing the model to a specified namespace.
- +0Prompt · +0Fine-tune a model on biglam/on_the_books to identify Jim Crow laws via hf jobs, push to davanstrien/jim-crow-laws-pi-kimi
- +0mAgent did · +0mExplored hf CLI help and dataset via uv run scripts: found 1785 examples, binary jim_crow label (512 positive/1273 negative), single train split; checked available job hardware
- +0mAgent did · +0mWrote train.py as a uv script fine-tuning roberta-base for text classification and submitted it as a detached HF Job on t4-medium hardware
- +1mFail · +1mJob status command didn't exist ('status' vs 'stats'), then logs --follow aborted after timing out while dependencies installed
- +2mIntervention · +2mDeveloper asked to check the job without tailing/following logsWhy: I didn't want the log follow to hang again, so I just asked for a one-off check.
- +3mFail · +3mFirst training job failed due to a deprecated `evaluation_strategy` argument; job cancelled and train.py patched to use `eval_strategy`
- +5mFail · +5mSecond job failed on `tokenizer` argument to Trainer; cancelled and patched to use `processing_class` instead
- +6mFail · +6mThird job failed again during preprocessing/label handling; cancelled and patched train.py further (renaming label column, adjusting map step)
- +6mAgent did · +6mResubmitted the fixed training script as a fourth HF Job on t4-medium and monitored logs through dependency installation and training
- +13mOutcome · +13mModel successfully pushed to davanstrien/jim-crow-laws-pi-kimi on the Hub: a roberta-base text-classification model with generated model card tags confirmed via model_info lookup
Next time I'd pin the transformers/trainer API version up front, since most of my failed jobs were just Trainer argument mismatches (evaluation_strategy, tokenizer vs processing_class) burning GPU minutes on HF Jobs. Cancelling and patching the script each time it failed was what actually got it working, but I should have caught those API changes locally before submitting to paid GPU hardware. Checking job status without following logs also saved me from the CLI hanging when a job took a while to install dependencies.