Skip to content
PifeatureData & ML1 file · +122 −6

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

13msession
1interventions
GOAL

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.

  1. Prompt · +0
    Fine-tune a model on biglam/on_the_books to identify Jim Crow laws via hf jobs, push to davanstrien/jim-crow-laws-pi-kimi
  2. Agent did · +0m
    Explored 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
  3. Agent did · +0m
    Wrote 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
  4. Fail · +1m
    Job status command didn't exist ('status' vs 'stats'), then logs --follow aborted after timing out while dependencies installed
  5. Intervention · +2m
    Developer asked to check the job without tailing/following logs
    Why: I didn't want the log follow to hang again, so I just asked for a one-off check.
  6. Fail · +3m
    First training job failed due to a deprecated `evaluation_strategy` argument; job cancelled and train.py patched to use `eval_strategy`
  7. Fail · +5m
    Second job failed on `tokenizer` argument to Trainer; cancelled and patched to use `processing_class` instead
  8. Fail · +6m
    Third job failed again during preprocessing/label handling; cancelled and patched train.py further (renaming label column, adjusting map step)
  9. Agent did · +6m
    Resubmitted the fixed training script as a fourth HF Job on t4-medium and monitored logs through dependency installation and training
  10. Outcome · +13m
    Model 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
VERDICT

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.

I tried this · 0

Discussion · 0

How Builds work