kiranpg/Qwen2.5-OCamler-1.5B-Instruct-v2
018
Qwen2.5-OCamler-1.5B-Instruct-v2
This model is a fine-tuned version of Qwen/Qwen2.5-Coder-1.5B-Instruct specialized for generating OCaml code.
Model Details
- Base Model: Qwen/Qwen2.5-Coder-1.5B-Instruct
- Fine-tuning Method: Group Relative Policy Optimization (GRPO) with LoRA
- Training Dataset: kiranpg/ocaml-training-problems
Training Configuration
GRPO Parameters
LoRA Configuration
Training Settings
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "kiranpg/Qwen2.5-OCamler-1.5B-Instruct-v2"
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))Intended Use
This model is designed for generating OCaml code solutions given natural language problem descriptions. It has been fine-tuned on OCaml programming problems to improve its ability to produce correct, idiomatic OCaml code.
Limitations
- The model may not always produce syntactically correct OCaml code
- Complex algorithmic problems may require multiple attempts
- The model works best with clear, well-specified problem descriptions
Training Infrastructure
Trained using TRL's GRPOTrainer with LoRA adapters.
