metadata
license: apache-2.0
base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct
tags:
- unsloth
- qwen2.5
- tool-calling
- function-calling
- cellsistant
- jupyter
- lora
- finetune
language:
- en
- ru
library_name: transformers
Qwen2.5-Coder-1.5B - Cellsistant Tool Calling
Fine-tuned version of Qwen2.5-Coder-1.5B for tool calling in Cellsistant (AI assistant for JupyterLab).
Model Details
- Base Model: Qwen/Qwen2.5-Coder-1.5B-Instruct
- Training Framework: Unsloth (2x faster)
- Training Data: 2,342 examples for tool calling
- Training Time: 6.57 minutes on Tesla T4
- Training Loss: 0.39 → 0.00042
Supported Tools
The model supports 19 tools for Jupyter notebook manipulation:
Notebook Tools
create_cell- Create new cellsupdate_cell- Update cell contentdelete_cell- Delete cellsget_cell_content- Read cell contentget_notebook_content- Get full notebookexecute_cell- Execute code cellsget_cell_output- Get cell outputanalyze_image- Analyze plots/images
File Tools
read_file- Read fileswrite_file- Write fileslist_directory- List directoriescreate_notebook- Create notebooksdelete_file- Delete filesrename_file- Rename/move files
Other Tools
run_shell- Execute shell commandsfind_in_notebook- Search in notebookreplace_in_cell- Replace text in cellsinstall_package- Install Python packageslist_packages- List installed packages
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen2.5-Coder-1.5B-Instruct",
device_map="cuda",
torch_dtype=torch.float16,
)
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct")
# Load LoRA adapters
model = PeftModel.from_pretrained(base_model, "coconut495/qwen2.5-coder-1.5b-cellsistant-tool-calling")
# Generate tool calls
prompt = '''<|im_start|>system
You are a helpful assistant with access to the following tools:
[{"type": "function", "function": {"name": "create_cell", ...}}]
<|im_end|>
<|im_start|>user
Add a code cell that prints hello<|im_end|>
<|im_start|>assistant
'''
inputs = tokenizer([prompt], return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=64, use_cache=False)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Training Details
| Parameter | Value |
|---|---|
| Epochs | 1 |
| Batch Size | 2 |
| Gradient Accumulation | 4 |
| Learning Rate | 2e-4 |
| LoRA Rank (r) | 16 |
| LoRA Alpha | 16 |
| Max Sequence Length | 4096 |
| Trainable Parameters | 18.5M (1.18%) |
Dataset
Training dataset contains 2,603 examples covering all 19 tools with various phrasings and edge cases.
License
Apache 2.0