Instructions to use guicybercode/Aira-2-portuguese-124M-mlx-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use guicybercode/Aira-2-portuguese-124M-mlx-4bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("guicybercode/Aira-2-portuguese-124M-mlx-4bit") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use guicybercode/Aira-2-portuguese-124M-mlx-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "guicybercode/Aira-2-portuguese-124M-mlx-4bit" --prompt "Once upon a time"
- Atomic Chat
Aira-2-portuguese-124M MLX 4-bit
This is nicholasKluge/Aira-2-portuguese-124M, a Portuguese language model, converted to 4-bit MLX so it can run with mlx-lm (size in the Files table below). I only tested it on the MLX CPU backend on Linux, not on Apple Silicon.
pip install mlx-lm
mlx_lm.generate --model guicybercode/Aira-2-portuguese-124M-mlx-4bit --prompt "<|startofinstruction|>Qual é a capital do Brasil?<|endofinstruction|>" --max-tokens 32 --temp 0
All credit for the model goes to the original authors, Nicholas Kluge Corrêa (nicholasKluge). I only converted the format. License: Apache-2.0, same as the original.
Versão quantizada do modelo nicholasKluge/Aira-2-portuguese-124M para uso local; todo o crédito é dos autores originais.
Files
| File | Quantization | Size |
|---|---|---|
| model.safetensors | 4-bit (group size 64), non-quantized tensors in float16 | 70 MB (70197083 bytes) |
How this was made
mlx-lm 0.32.2 with mlx 0.32.4 (CPU backend, Linux x86_64):
mlx_lm.convert --hf-path nicholasKluge/Aira-2-portuguese-124M --mlx-path Aira-2-portuguese-124M-mlx-4bit -q --q-bits 4 --dtype float16
Before converting, the weight names in model.safetensors were renamed from transformer.* to * and the tied lm_head.weight was dropped, because mlx-lm's gpt2 loader expects the original GPT-2 key layout and rejected the file otherwise (Received 148 parameters not in model). No weight values were changed; the converted copy was passed to --hf-path instead of the repo id.
--dtype float16 was used because, on the MLX CPU backend on Linux, a bfloat16 conversion produced only <unk> tokens in testing, while float16 produced normal text. Not tested on Apple Silicon.
Usage
pip install mlx-lm
mlx_lm.generate --model guicybercode/Aira-2-portuguese-124M-mlx-4bit --prompt "<|startofinstruction|>Qual é a capital do Brasil?<|endofinstruction|>" --max-tokens 32 --temp 0
Smoke test
Prompt: <|startofinstruction|>Qual é a capital do Brasil?<|endofinstruction|>, 32 tokens, temperature 0, run on the MLX CPU backend on Linux. Only a load-and-generate check, not an evaluation.
A capital do Brasil é Brasília.
No benchmarks were run on this quantized model. See the original model card for the authors' evaluations and intended use.
- Downloads last month
- 49
4-bit
Model tree for guicybercode/Aira-2-portuguese-124M-mlx-4bit
Base model
pierreguillou/gpt2-small-portuguese