Instructions to use shawhin/gemma-3-1b-tool-use with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
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", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from shawhin/gemma-3-1b-tool-use: direct link, hf CLI and curl.
- Browser
- Download file 1.78 kB
-
https://huggingface.co/shawhin/gemma-3-1b-tool-use/resolve/main/README.md
- Command line
-
hf download hf://shawhin/gemma-3-1b-tool-use/README.md
-
curl -L -o README.md https://huggingface.co/shawhin/gemma-3-1b-tool-use/resolve/main/README.md
1.78 kB
| base_model: google/gemma-3-1b-it | |
| library_name: transformers | |
| model_name: gemma-3-1b-tool-use | |
| tags: | |
| - generated_from_trainer | |
| - trl | |
| - sft | |
| licence: license | |
| datasets: | |
| - shawhin/tool-use-finetuning | |
| # Model Card for gemma-3-1b-tool-use | |
| This model is a fine-tuned version of [google/gemma-3-1b-it](https://huggingface.co/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](https://github.com/huggingface/trl). | |
| Resources: | |
| - [YouTube Video](https://youtu.be/fAFJYbtTsC0) | |
| - [Blog Post](https://medium.com/@shawhin/fine-tuning-llms-for-tool-use-5f1db03d7c55) | |
| - [GitHub Repo](https://github.com/ShawhinT/llm-tool-use-ft) | |
| - [Training Data](https://huggingface.co/datasets/shawhin/tool-use-finetuning) | |
| ## Quick start | |
| ```python | |
| 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"]) | |
| ``` | |
| ## Training procedure | |
| This model was trained with SFT. | |
| ### Framework versions | |
| - TRL: 0.19.1 | |
| - Transformers: 4.53.1 | |
| - Pytorch: 2.7.1 | |
| - Datasets: 4.0.0 | |
| - Tokenizers: 0.21.2 | |
| ## Citations | |
| Cite TRL as: | |
| ```bibtex | |
| @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}} | |
| } | |
| ``` |