Instructions to use proxectonos/LLama-Carvalho-PT-GL_300k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use proxectonos/LLama-Carvalho-PT-GL_300k with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Nos-PT/Llama-Carvalho-PT-GL") model = PeftModel.from_pretrained(base_model, "proxectonos/LLama-Carvalho-PT-GL_300k") - Transformers
How to use proxectonos/LLama-Carvalho-PT-GL_300k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="proxectonos/LLama-Carvalho-PT-GL_300k") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("proxectonos/LLama-Carvalho-PT-GL_300k", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use proxectonos/LLama-Carvalho-PT-GL_300k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "proxectonos/LLama-Carvalho-PT-GL_300k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "proxectonos/LLama-Carvalho-PT-GL_300k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/proxectonos/LLama-Carvalho-PT-GL_300k
- SGLang
How to use proxectonos/LLama-Carvalho-PT-GL_300k with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "proxectonos/LLama-Carvalho-PT-GL_300k" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "proxectonos/LLama-Carvalho-PT-GL_300k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "proxectonos/LLama-Carvalho-PT-GL_300k" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "proxectonos/LLama-Carvalho-PT-GL_300k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use proxectonos/LLama-Carvalho-PT-GL_300k with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for proxectonos/LLama-Carvalho-PT-GL_300k to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for proxectonos/LLama-Carvalho-PT-GL_300k to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for proxectonos/LLama-Carvalho-PT-GL_300k to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="proxectonos/LLama-Carvalho-PT-GL_300k", max_seq_length=2048, ) - Docker Model Runner
How to use proxectonos/LLama-Carvalho-PT-GL_300k with Docker Model Runner:
docker model run hf.co/proxectonos/LLama-Carvalho-PT-GL_300k
proxectonos/Llama-Carvalho-PT-GL_300k
This repository contains proxectonos/Llama-Carvalho-PT-GL_300k, a LoRA adapter for machine translation from Spanish to Galician, built on top of Nos-PT/Llama-Carvalho-PT-GL.
Why this model exists
This checkpoint is the 300k training-size model from our data-scaling experiments on low-resource machine translation with LLM fine-tuning. It is being published because it was the best-performing model for the es-gl direction among the four training sizes we evaluated: 30k, 300k, 600k, and 3.6M parallel sentence pairs.
The motivation for releasing this model is not just to provide another translation adapter, but to document a central experimental result: for Spanish-to-Galician, a closely related language pair, the best translation quality was obtained with a medium-sized corpus rather than with the largest available one. In our experiments, the 300k model achieved the strongest overall results for es-gl, especially in BLEU and human evaluation.
This makes the model an important counterpart to the 3.6M English-Galician checkpoint from the same study. Together, these releases illustrate the main conclusion of the work: the optimal fine-tuning size depends on linguistic distance, and more data is not always better for closely related language pairs.
Model details
- Base model:
Nos-PT/Llama-Carvalho-PT-GL - Model type: LoRA adapter for causal language modeling used as machine translation
- Task: Machine translation
- Direction: Spanish -> Galician
- Languages: Spanish, Galician
- Training method: Supervised Fine-Tuning with LoRA
- Training size: 300,000 parallel sentence pairs
Training data
The adapter was trained on 300k Spanish-Galician parallel sentence pairs.
The training data comes from the CorpusNos MT dataset and includes only human-written text. The corpus covers several text types, including:
- formal institutional language
- scientific text
- spoken-domain material
- multi-word expressions
Training setup
All experiments in the paper used the same base model and the same fine-tuning setup so that differences in quality could be attributed to data scale rather than to architecture changes.
- Base model:
Llama-Carvalho-PT-GL - Fine-tuning strategy: LoRA
- Learning rate:
5e-6 - Scheduler: cosine
- Warmup steps:
150 - Weight decay:
0.01 - Per-device train batch size:
16 - Gradient accumulation steps:
4 - Precision:
bf16
Evaluation summary
This model was evaluated in the paper against other checkpoints trained on smaller and larger Spanish-Galician corpora (30k, 600k, 3.6M).
Among the es-gl models, this 300k checkpoint obtained the best overall results:
- Average BLEU across 6 benchmark test sets:
60.63 - Average COMET across 6 benchmark test sets:
0.9076 - Human evaluation on 74 test-suite sentences:
53.67%correct
The 6 benchmark test sets used to compute the average BLEU and COMET values were:
gold1gold2test-suiteflorestatoebataCoN
The first 3 datasets are our own, you can find the links here. Human evaluation was carried out by 3 native Galician annotators using binary correct/incorrect judgments.
These results support the main finding for es-gl: unlike more distant language pairs, Spanish-Galician reaches its best quality at an intermediate training size, while larger corpora can introduce source-language interference.
Intended use
This model is intended for:
- research on Spanish-Galician machine translation
- evaluation of data scaling in LLM fine-tuning
- practical translation workflows into Galician when using the Carvalho model family
Limitations
- This is a LoRA adapter, not a standalone merged model.
- It is specialized for Spanish-to-Galician translation and should not be treated as a general-purpose chat assistant.
- The model inherits the capabilities and limitations of the base model.
- As reported in the paper, translation quality depends strongly on language pair and corpus design; the best training size for
es-glshould not be assumed to be optimal for other directions.
- Downloads last month
- 27