Instructions to use PatoFlamejanteTV/QuackPTBR40M-Train with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PatoFlamejanteTV/QuackPTBR40M-Train with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PatoFlamejanteTV/QuackPTBR40M-Train")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PatoFlamejanteTV/QuackPTBR40M-Train") model = AutoModelForCausalLM.from_pretrained("PatoFlamejanteTV/QuackPTBR40M-Train") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use PatoFlamejanteTV/QuackPTBR40M-Train with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PatoFlamejanteTV/QuackPTBR40M-Train" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PatoFlamejanteTV/QuackPTBR40M-Train", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/PatoFlamejanteTV/QuackPTBR40M-Train
- SGLang
How to use PatoFlamejanteTV/QuackPTBR40M-Train 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 "PatoFlamejanteTV/QuackPTBR40M-Train" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PatoFlamejanteTV/QuackPTBR40M-Train", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "PatoFlamejanteTV/QuackPTBR40M-Train" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PatoFlamejanteTV/QuackPTBR40M-Train", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use PatoFlamejanteTV/QuackPTBR40M-Train with Docker Model Runner:
docker model run hf.co/PatoFlamejanteTV/QuackPTBR40M-Train
PTBR-40M LLM
PTBR-40M LLM is a small Portuguese causal language model (~40M parameters) trained on a mixture of Portuguese web text and reasoning data.
The model is designed to demonstrate that functional language models can be trained quickly on a single GPU.
Training can be completed in approximately 30–40 minutes on a T4 GPU using small dataset slices.
Model Details
Architecture
| Property | Value |
|---|---|
| Parameters | ~40M |
| Layers | 12 |
| Hidden size | 512 |
| Attention heads | 8 |
| Context length | 256 tokens |
| Positional encoding | RoPE |
Framework:
- Transformers
Training Data
The model was trained on a mixture of two datasets:
Portuguese reasoning dataset
Dataset:
- corre-social/s1_dataset_ptbr_1k_tokenized
Contains:
- reasoning examples
- chain-of-thought style explanations
- Portuguese instructional data
Portuguese web corpus
Dataset:
- Madras1/corpus-ptbr-v1
Contains:
- large Portuguese text corpus
- mixed web content
- billions of tokens in the full dataset
For training speed, only a subset of the corpus was used.
Training Procedure
Training configuration:
| Parameter | Value |
|---|---|
| Epochs | 1 |
| Batch size | 16 |
| Gradient accumulation | 2 |
| Learning rate | 4e-4 |
| Context length | 256 |
| Precision | FP16 |
Hardware:
- NVIDIA T4 GPU
Training time:
- ~30–40 minutes
Usage
from transformers import pipeline
generator = pipeline(
"text-generation",
model="username/ptbr-40m-llm"
)
print(generator(
"Explique o que é inteligência artificial:",
max_new_tokens=80
))
- Downloads last month
- 3
Model tree for PatoFlamejanteTV/QuackPTBR40M-Train
Base model
PatoFlamejanteTV/QuackPTBR40M