Downloads · 30 days
36
31% of all-time downloads
kiranpg/Qwen2.5-OCamler-1.5B-Instruct-v2
Qwen2.5-OCamler-1.5B-Instruct-v2 is a text generation model from kiranpg. 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
36
31% of all-time downloads
All-time downloads
118
Public
Parameters
1.5B
3.1 GB on disk
Likes
1
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 | 4 |
| Gradient Accumulation Steps | 1 |
| Effective Batch Size | 4 |
| Learning Rate | 1e-6 |
| Number of Epochs | 3 |
| Max Prompt Length | 800 |
| Max Completion Length | 700 |
| Num Generations | 8 |
| Temperature | 1.0 |
| Beta (KL coefficient) | 0.04 |
| Parameter | Value |
|---|---|
| LoRA Rank (r) | 32 |
| LoRA Alpha | 64 |
| LoRA Dropout | 0.05 |
| Parameter | Value |
|---|---|
| Logging Steps | 1 |
| Save Steps | 100 |
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))
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.
Trained using TRL's GRPOTrainer with LoRA adapters.