Downloads · 30 days
13
16% of all-time downloads
nilenso/Qwen2.5-OCamler-1.5B-Instruct
Qwen2.5-OCamler-1.5B-Instruct is a text generation model from nilenso. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned version of Qwen/Qwen2.5-Coder-1.5B-Instruct specialized for generating OCaml code.
Downloads · 30 days
13
16% of all-time downloads
All-time downloads
79
Public
Parameters
1.5B
3.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.1 GB · 99%
From the Hugging Face model README
This model is a fine-tuned version of Qwen/Qwen2.5-Coder-1.5B-Instruct specialized for generating OCaml code.
| Parameter | Value |
|---|---|
| Batch Size | 2 |
| Gradient Accumulation Steps | 4 |
| Effective Batch Size | 8 |
| Learning Rate | 5e-6 |
| Number of Epochs | 3 |
| Max Prompt Length | 800 |
| Max Completion Length | 700 |
| LR Scheduler Type | cosine |
| Warmup Ratio | 0.03 |
| Weight Decay | 0.01 |
| Max Grad Norm | 1.0 |
| Optimizer | adamw_8bit |
| Dataloader Num Workers | 2 |
| Parameter | Value |
|---|---|
| LoRA Rank (r) | 32 |
| LoRA Alpha | 64 |
| LoRA Dropout | 0.05 |
| Parameter | Value |
|---|---|
| Logging Steps | 1 |
| Eval Steps | 500 |
| Save Steps | 100 |
| Save Total Limit | 30 |
| Parameter | Value |
|---|---|
| Num Generations | 8 |
| Temperature | 1.0 |
| Beta (KL coefficient) | 0.01 |
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "kiranpg/Qwen2.5-OCamler-1.5B-Instruct"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
messages = [
{"role": "user", "content": "Write an OCaml function to compute the factorial of a number."}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7, do_sample=True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
This model is designed for generating OCaml code solutions given natural language problem descriptions. It has been fine-tuned on OCaml programming problems using GRPO with real-time feedback from the OCaml compiler and test suite to improve its ability to produce correct, idiomatic OCaml code.
Trained using TRL's GRPOTrainer with OCaml compiler verification for rewards. The reward system uses a graduated structure: