shawhin/tool-use-finetuning
Viewer • Updated • 597 • 153 • 21
How to use shawhin/gemma-3-1b-tool-use with Transformers:
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("shawhin/gemma-3-1b-tool-use", dtype="auto")This model is a fine-tuned version of google/gemma-3-1b-it for function calling. The code and other resources for this project are linked below. It has been trained using TRL.
Resources:
from transformers import pipeline
question = "What day of the week was Nov 4 1998?"
generator = pipeline("text-generation", model="shawhin/gemma-3-1b-tool-use", device="cuda")
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
print(output["generated_text"])
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}}
}