Downloads · 30 days
0
pharo-llm/pharo-one-qwen2-5-3B
pharo-one-qwen2-5-3B is a text generation model from pharo-llm. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
pharo-one is a collection of language models and adapters for Pharo.
Downloads · 30 days
0
Access
Public
Updated Aug 3, 2026
Repo size
2.2 GB
Likes
1
Public
Click a slice to open those files.
.md11.6 KB · 88%
From the Hugging Face model README
pharo-one is a collection of language models and adapters for Pharo.
The first release is a continued-pretraining checkpoint trained only to improve a compatible base model's understanding of Pharo syntax, source-code structure, message-passing conventions, and common language patterns.
It is not yet fine-tuned for code generation, code completion, test generation, bug fixing, code repair, or instruction following. Those capabilities may be introduced in later checkpoints within the collection.
Pharo is a low-resource programming language with syntax and conventions that differ significantly from mainstream languages. The purpose of this first checkpoint is language adaptation only: it teaches the model what Pharo code looks like before any downstream task-specific fine-tuning.
The pharo-one collection may eventually contain multiple checkpoints trained for different tasks and model sizes.
The first checkpoint is:
Future checkpoints may add supervised fine-tuning for code generation, completion, testing, repair, or other downstream tasks.
Each checkpoint should be used according to the task and training configuration described in its repository.
The underlying base model may differ between checkpoints. Consult the model configuration, adapter configuration, or repository metadata to identify the compatible base checkpoint.
Large language models perform well on popular programming languages such as Python, Java, JavaScript, and C++, but their performance is often weaker on low-resource languages such as Pharo.
Pharo inherits distinctive features from Smalltalk, including:
General-purpose code models may not represent these characteristics accurately. The pharo-one collection adapts coding models to Pharo syntax, APIs, idioms, and development patterns.
The first model in this collection uses the following training stage.
A compatible causal language model is adapted to Pharo source code using next-token prediction.
This stage helps the model learn:
Training examples are tokenized, concatenated, and packed into fixed-length causal language-modeling blocks.
The first pharo-one checkpoint is intended only to improve the model's internal representation of Pharo code.
It is trained to learn:
It should not be presented as a task-specialized model for code generation, test generation, bug fixing, or fill-in-the-middle completion.
Install the required libraries:
pip install -U transformers accelerate torch peft
Some checkpoints may require additional packages. Refer to the corresponding model repository for checkpoint-specific requirements.
Use this pattern for checkpoints distributed as complete models:
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "<PHARO_ONE_MODEL_ID>"
tokenizer = AutoTokenizer.from_pretrained(
model_name,
trust_remote_code=True,
)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto",
trust_remote_code=True,
).eval()
Use this pattern for checkpoints distributed as adapters:
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model_name = "<COMPATIBLE_BASE_MODEL_ID>"
adapter_name = "<PHARO_ONE_ADAPTER_ID>"
tokenizer = AutoTokenizer.from_pretrained(
base_model_name,
trust_remote_code=True,
)
model = AutoModelForCausalLM.from_pretrained(
base_model_name,
torch_dtype="auto",
device_map="auto",
trust_remote_code=True,
)
model = PeftModel.from_pretrained(
model,
adapter_name,
).eval()
The base model must match the checkpoint used to train the adapter. Check adapter_config.json or the checkpoint repository for the required base-model identifier.
prompt = """Collection >> selectEven
^ self select: [ :each |
"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.inference_mode():
outputs = model.generate(
**inputs,
max_new_tokens=128,
do_sample=False,
)
generated_text = tokenizer.decode(
outputs[0][inputs.input_ids.shape[1]:],
skip_special_tokens=True,
)
print(generated_text)
The model may continue the Pharo source sequence with text such as:
Collection >> selectEven
^ self select: [ :each | each even ]
prompt = """Generate a Pharo unit test for this method:
Calculator >> add: firstNumber to: secondNumber
^ firstNumber + secondNumber
"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.inference_mode():
outputs = model.generate(
**inputs,
max_new_tokens=192,
do_sample=False,
)
completion = tokenizer.decode(
outputs[0][inputs.input_ids.shape[1]:],
skip_special_tokens=True,
)
print(completion)
A future task-specific checkpoint may produce results such as:
CalculatorTest >> testAdd
self
assert: (calculator add: 2 to: 3)
equals: 5
prompt = """Fix the following Pharo method:
Collection >> firstEven
^ self detect: [ :each | each odd ]
"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.inference_mode():
outputs = model.generate(
**inputs,
max_new_tokens=128,
do_sample=False,
)
completion = tokenizer.decode(
outputs[0][inputs.input_ids.shape[1]:],
skip_special_tokens=True,
)
print(completion)
A future task-specific checkpoint may produce corrections such as:
Collection >> firstEven
^ self detect: [ :each | each even ]
The first checkpoint uses ordinary causal-language-model input rather than a task-specific instruction format.
A checkpoint may use:
Always consult the individual checkpoint model card for the recommended prompt format.
Training settings may differ between checkpoints. A typical language-adaptation run may use:
The exact values for context length, learning rate, batch size, LoRA rank, number of epochs, and target modules are checkpoint-specific.
Models in the collection should be evaluated on task-appropriate Pharo datasets.
Possible metrics include:
Evaluation results should be reported in each checkpoint repository when available.
The first pharo-one checkpoint is intended for:
It is not intended to be evaluated or advertised as a specialized code-generation, test-generation, bug-fixing, or code-completion model without additional task-specific fine-tuning.
Generated code should be reviewed, executed, and tested before use in production.
Users should:
Exact results may vary across:
For reproducible experiments, record:
This repository is released under the MIT License.
Individual checkpoints may also be subject to the license and usage terms of their underlying base models and training datasets. Users are responsible for reviewing all applicable licenses before use, redistribution, or deployment.