Instructions to use PatoFlamejanteTV/QuackPTBR40M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PatoFlamejanteTV/QuackPTBR40M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PatoFlamejanteTV/QuackPTBR40M")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PatoFlamejanteTV/QuackPTBR40M") model = AutoModelForCausalLM.from_pretrained("PatoFlamejanteTV/QuackPTBR40M") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use PatoFlamejanteTV/QuackPTBR40M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PatoFlamejanteTV/QuackPTBR40M" # 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", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/PatoFlamejanteTV/QuackPTBR40M
- SGLang
How to use PatoFlamejanteTV/QuackPTBR40M 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" \ --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", "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" \ --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", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use PatoFlamejanteTV/QuackPTBR40M with Docker Model Runner:
docker model run hf.co/PatoFlamejanteTV/QuackPTBR40M
PTBR-40M Base
PTBR-40M Base is a small Portuguese causal language model architecture (≈40M parameters) designed for experimentation and fast training on consumer GPUs such as a T4.
This repository contains the randomly initialized base model before training.
The model is intended for:
- educational purposes
- rapid LLM prototyping
- small-scale Portuguese experiments
- architecture research
Model Details
Architecture
The model uses a GPT-NeoX style transformer decoder architecture.
Key characteristics:
| Property | Value |
|---|---|
| Parameters | ~40M |
| Layers | 12 |
| Hidden size | 512 |
| Attention heads | 8 |
| Context length | 256 tokens |
| Positional encoding | Rotary (RoPE) |
Framework:
- Transformers
Intended Use
This base model is not trained and therefore cannot generate meaningful language.
It is intended to be used as:
- a starting point for pretraining
- a fine-tuning base
- a toy LLM architecture
Example use cases:
- research experiments
- educational demonstrations
- low-resource language model training
Training Procedure
This model contains randomly initialized weights.
Typical training setup used with this architecture:
- optimizer: AdamW
- learning rate: 4e-4
- context length: 256
- batch size: 16–32 (depending on hardware)
The architecture is optimized to allow training on a single T4 GPU in small-scale experiments.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("username/ptbr-40m-base")
tokenizer = AutoTokenizer.from_pretrained("gpt2")
inputs = tokenizer("Olá mundo", return_tensors="pt")
outputs = model(**inputs)
- Downloads last month
- 4