Views
No views yet
Thought: I need to calculate this.
```python
result = 2 + 2
final_answer(result)
```| Parameter | Value |
|---|---|
| LoRA Rank | 8 |
| LoRA Alpha | 16 |
| Target Modules | q_proj, v_proj |
| Trainable Parameters | 12.2M (0.47% of base) |
| Training Steps | 30 |
| Learning Rate | 2e-4 |
| Batch Size | 4 |
| Max Sequence Length | 2048 |
| Hardware | NVIDIA RTX 3090 (24GB) |
| Training Time | ~5.5 hours |
| Prompt Mode | Format Compliance | Answer Accuracy |
|---|---|---|
| Minimal | N/A | N/A |
| Default | N/A | N/A |
| None | N/A | N/A |
1You are a CodeAgent that solves tasks by writing and executing Python code.
2
3Always respond with Thought + Python code block. Example:
4
5Thought: I need to calculate this.
6```python
7result = 2 + 2
8final_answer(result)
9```
10
11Call final_answer(result) when done. Now Begin!1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3
4# Load base model
5base_model = AutoModelForCausalLM.from_pretrained(
6 "LiquidAI/LFM2.5-1.2B-Instruct",
7 device_map="auto",
8 torch_dtype="bfloat16",
9)
10tokenizer = AutoTokenizer.from_pretrained("LiquidAI/LFM2.5-1.2B-Instruct")
11
12# Load LoRA adapter
13model = PeftModel.from_pretrained(base_model, "krzysztofwos/LFM2.5-1.2B-CodeAgent-LoRA")
14
15# Generate
16messages = [{"role": "user", "content": "What is 15 * 23?"}]
17prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
18inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
19
20outputs = model.generate(
21 **inputs,
22 max_new_tokens=512,
23 temperature=0.3,
24 min_p=0.15,
25)
26print(tokenizer.decode(outputs[0], skip_special_tokens=True))1from smolagents import CodeAgent, FinalAnswerTool, TransformersModel
2
3model = TransformersModel(
4 model_id="LiquidAI/LFM2.5-1.2B-Instruct",
5 peft_model="krzysztofwos/LFM2.5-1.2B-CodeAgent-LoRA",
6)
7
8agent = CodeAgent(
9 tools=[FinalAnswerTool()],
10 model=model,
11)
12
13result = agent.run("What is 15 * 23?")
14print(result)1@misc{lfm2.5_1.2b_codeagent_lora,
2 author = {krzysztofwos},
3 title = {LFM2.5-1.2B-CodeAgent-LoRA},
4 year = {2025},
5 publisher = {Hugging Face},
6 url = {https://huggingface.co/krzysztofwos/LFM2.5-1.2B-CodeAgent-LoRA}
7}