NousResearch/hermes-function-calling-v1
Viewer • Updated • 11.6k • 16.9k • 407
How to use TymofiiNasobko/MamayLM-function-calling with Transformers:
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("TymofiiNasobko/MamayLM-function-calling", dtype="auto")This model is a fine-tuned version of INSAIT-Institute/MamayLM-Gemma-3-4B-IT-v1.0. It has been trained using TRL.
This is the first iteration of fine-tuning MamayLM for function calling. In the future, we plan to add metrics and improve training.
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.
find_longest_common_sequence_length(ground_truth_tokens, generated_tokens) / len(ground_truth_tokens)Accuracy in function calling: 0.38107
Match in helpful exchange: 0.07440
Accuracy in function calling: 0.95415
Match in helpful exchange: 0.09937
from peft import PeftModel, PeftConfig
from transformers import AutoModelForCausalLM, AutoTokenizer
peft_model_id = "TymofiiNasobko/MamayLM-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}}
}
Base model
google/gemma-3-4b-pt
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("TymofiiNasobko/MamayLM-function-calling", dtype="auto")