Run this model with HF Jobs

Run manucif/latamgpt-1b-sft 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 and TRL to fine-tune https://huggingface.co/manucif/latamgpt-1b-sft. Ask me which dataset to train on, then push the LoRA adapter to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs and Transformers to run batch inference with https://huggingface.co/manucif/latamgpt-1b-sft on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the predictions back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs and Lighteval to evaluate https://huggingface.co/manucif/latamgpt-1b-sft. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/manucif/latamgpt-1b-sft with Transformers and bitsandbytes. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

latamgpt-1b-sft

Full supervised fine-tune of meta-llama/Llama-3.2-1B on a Latin American instruction mixture, with sequence packing and assistant-only loss masking.

Training data

Dataset Role
latam-gpt/wikipedia-qa-iberoamerica-clean Iberoamerican QA
latam-gpt/tulu-3-sft-mixture-no-identity-clean General SFT mixture
latam-gpt/sft-mcqa-unified-clean Multiple-choice QA
latam-gpt/self-identity-v3-clean Self-identity
latam-gpt/copuchatV2-clean Chilean conversational

After tokenization with the Llama 3 chat template and FFD packing at 4096 tokens (99.16% packing efficiency), the training set is 175,995 packed sequences (~721M tokens) with 119,573 validation examples.

Training setup

  • Base model: meta-llama/Llama-3.2-1B
  • Method: Full fine-tune (no LoRA)
  • Sequence length: 4096, packed with assistant-only loss masking
  • Epochs: 2
  • Learning rate: 1e-5 (cosine, 3% warmup)
  • Batch: 8 per device × 8 grad accumulation × 2 GPUs = 128 effective
  • Precision: bf16 + DeepSpeed ZeRO-2 + gradient checkpointing + Flash Attention 2
  • Hardware: 2× H100 80GB
  • Wall time: ~7.5h

Results

Metric Value
train_loss 0.8579
eval_loss 0.8910
epoch 2.0
train_samples 175,995

Usage

from transformers import AutoTokenizer, AutoModelForCausalLM

tok = AutoTokenizer.from_pretrained("latam-gpt/latamgpt-1b-sft")
model = AutoModelForCausalLM.from_pretrained("latam-gpt/latamgpt-1b-sft", torch_dtype="bfloat16", device_map="auto")

messages = [{"role": "user", "content": "¿Cuál es la capital de Chile?"}]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(inputs, max_new_tokens=256, do_sample=True, temperature=0.7)
print(tok.decode(out[0][inputs.shape[-1]:], skip_special_tokens=True))

License

Inherits the Llama 3.2 Community License from the base model.

Downloads last month
16
Safetensors
Model size
1B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for manucif/latamgpt-1b-sft

Finetuned
(998)
this model