Views
No views yet
gemma-3-270m-it-function-tuned-202601231532system_prompt_format.txt file, which defines the exact prompt structure the model was trained on.{tool_descriptions} placeholder should be replaced with the list of tools available for a given task.1You are a function calling AI model. Given a user query, the following tools are available:
2{tool_descriptions}
3
4Use this format to respond:
5```json
6{{
7 "thought": "Based on the query, I need to use [tool_name] because [your reasoning].",
8 "tool": "tool_name",
9 "arguments": {{
10 "arg_name1": "value1"
11 }}
12}}
## Model Details
* **Base Model:** `google/gemma-3-270m-it`
* **Curriculum Training (Replay of Base Model's Data):** `0%`
## Training Data
* **Dataset:** `broadfield-dev/gemma-3-refined-tool-data-1769172431`
* **Instruction Column:** `instruction`
* **Output Column:** `output`
## How to Use
Load the `system_prompt_format.txt` file and inject your tool definitions into the `{tool_descriptions}` placeholder.
**Example:**
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
from huggingface_hub import hf_hub_download
import json
repo_id = "broadfield-dev/gemma-3-270m-it-function-tuned-202601231532"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForCausalLM.from_pretrained(repo_id)
# Load the prompt template from the Hub
prompt_template_path = hf_hub_download(repo_id=repo_id, filename="system_prompt_format.txt")
with open(prompt_template_path, 'r') as f:
prompt_template = f.read()
# Define your tools and format them as a string
my_tools_string = "- Tool: \`search\`\n - Description: Searches the web.\n - Arguments: {"query": {"type": "string"}}"
system_prompt = prompt_template.format(tool_descriptions=my_tools_string)
instruction = "What is the weather in New York?"
chat = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": instruction},
]
prompt = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[inputs.input_ids.shape[-1]:], skip_special_tokens=True))