Downloads · 30 days
0
TymofiiNasobko/Lapa-function-calling
Lapa-function-calling is a machine learning model from TymofiiNasobko. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as gemma.
This model is a fine-tuned version of lapa-llm/lapa-v0.1.2-instruct. It has been trained using TRL.
Downloads · 30 days
0
Access
Public
Updated Dec 31, 2025
Repo size
34.3 GB
Likes
2
Trending 1
Click a slice to open those files.
.safetensors593 MB · 94%
From the Hugging Face model README
This model is a fine-tuned version of lapa-llm/lapa-v0.1.2-instruct. It has been trained using TRL.
The support of vast.ai team allowed this fine tune to happen. Many thanks!
This is the first iteration of fine-tuning Lapa for function calling. In the future, we plan to add metrics and improve training. <br> During this phase new tokens (including tool_call) were introduced to the model and we evaluated how well it uses and understands the purpose of tool_call.<br>
Accuracy in function calling (if response contains tool_call token) - find_longest_common_sequence_length(ground_truth_tokens, generated_tokens) / len(ground_truth_tokens)<br> Match in helpful exchange (if response does not contain tool_call token) - Computes the percentage of matching elements between generated tokens and ground truth tokens<br>
Accuracy in function calling: 0.48022<br> Match in helpful exchange: 0.09064<br>
Accuracy in function calling: 0.94833<br> Match in helpful exchange: 0.09829
from peft import PeftModel, PeftConfig
from transformers import AutoModelForCausalLM, AutoTokenizer
peft_model_id = "TymofiiNasobko/Lapa-function-calling"
peftconfig = PeftConfig.from_pretrained(peft_model_id)
model = AutoModelForCausalLM.from_pretrained(
peftconfig.base_model_name_or_path,
attn_implementation="eager",
device_map=device,
)
tokenizer = AutoTokenizer.from_pretrained(peft_model_id)
model.resize_token_embeddings(len(tokenizer))
model = PeftModel.from_pretrained(model, peft_model_id)
model = model.to(compute_dtype)
model = model.eval()
This model was trained with SFT.
Cite TRL as:
@misc{vonwerra2022trl,
title = {{TRL: Transformer Reinforcement Learning}},
author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
year = 2020,
journal = {GitHub repository},
publisher = {GitHub},
howpublished = {\url{https://github.com/huggingface/trl}}
}