Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: unsloth/functiongemma-270m-it
|
| 3 |
+
library_name: gguf
|
| 4 |
+
license: gemma
|
| 5 |
+
tags:
|
| 6 |
+
- function-calling
|
| 7 |
+
- tool-use
|
| 8 |
+
- agent
|
| 9 |
+
- llama-cpp
|
| 10 |
+
- gguf
|
| 11 |
+
- unsloth
|
| 12 |
+
- llama-agent
|
| 13 |
+
datasets:
|
| 14 |
+
- victor/functiongemma-agent-sft
|
| 15 |
+
pipeline_tag: text-generation
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# FunctionGemma Agent GGUF
|
| 19 |
+
|
| 20 |
+
A fine-tuned version of [FunctionGemma-270M](https://huggingface.co/unsloth/functiongemma-270m-it) for agentic tool-calling tasks, converted to GGUF format for use with llama.cpp and [llama-agent](https://github.com/ggml-org/llama.cpp/tree/master/tools/agent).
|
| 21 |
+
|
| 22 |
+
## Model Details
|
| 23 |
+
|
| 24 |
+
| Property | Value |
|
| 25 |
+
|----------|-------|
|
| 26 |
+
| Base Model | [unsloth/functiongemma-270m-it](https://huggingface.co/unsloth/functiongemma-270m-it) |
|
| 27 |
+
| Fine-tuned Model | [victor/functiongemma-agent-finetuned](https://huggingface.co/victor/functiongemma-agent-finetuned) |
|
| 28 |
+
| Training Dataset | [victor/functiongemma-agent-sft](https://huggingface.co/datasets/victor/functiongemma-agent-sft) |
|
| 29 |
+
| Quantization | Q4_K_M (4-bit) |
|
| 30 |
+
| Parameters | 270M |
|
| 31 |
+
|
| 32 |
+
## Training
|
| 33 |
+
|
| 34 |
+
Fine-tuned using [Unsloth](https://github.com/unslothai/unsloth) with LoRA on HuggingFace Jobs infrastructure.
|
| 35 |
+
|
| 36 |
+
**Training Configuration:**
|
| 37 |
+
- LoRA rank: 128, alpha: 256
|
| 38 |
+
- Epochs: 3
|
| 39 |
+
- Learning rate: 2e-4
|
| 40 |
+
- Batch size: 4, gradient accumulation: 2
|
| 41 |
+
- Hardware: NVIDIA A100-80GB
|
| 42 |
+
- Training method: SFT with `train_on_responses_only`
|
| 43 |
+
|
| 44 |
+
**Dataset:** 7,500 synthetic examples covering:
|
| 45 |
+
- Multi-step tool chaining (glob → read → edit)
|
| 46 |
+
- Error recovery patterns
|
| 47 |
+
- Clarification dialogs
|
| 48 |
+
- No-tool responses
|
| 49 |
+
- Parallel tool calls
|
| 50 |
+
|
| 51 |
+
## Tools
|
| 52 |
+
|
| 53 |
+
The model is trained on 5 tools matching llama-agent:
|
| 54 |
+
|
| 55 |
+
| Tool | Description |
|
| 56 |
+
|------|-------------|
|
| 57 |
+
| `read_file` | Read file contents with line numbers |
|
| 58 |
+
| `write_file` | Create or overwrite a file |
|
| 59 |
+
| `edit_file` | Find and replace text in a file |
|
| 60 |
+
| `glob` | Find files matching pattern |
|
| 61 |
+
| `bash` | Execute shell command |
|
| 62 |
+
|
| 63 |
+
## Usage
|
| 64 |
+
|
| 65 |
+
### With llama.cpp
|
| 66 |
+
|
| 67 |
+
```bash
|
| 68 |
+
# Download
|
| 69 |
+
wget https://huggingface.co/victor/functiongemma-agent-gguf/resolve/main/functiongemma-270m-it.Q4_K_M.gguf
|
| 70 |
+
|
| 71 |
+
# Run inference
|
| 72 |
+
./llama-cli -m functiongemma-270m-it.Q4_K_M.gguf -p "<start_of_turn>user
|
| 73 |
+
Read the main.py file
|
| 74 |
+
<end_of_turn>
|
| 75 |
+
<start_of_turn>model"
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
### With llama-agent
|
| 79 |
+
|
| 80 |
+
```bash
|
| 81 |
+
./llama-agent -m functiongemma-270m-it.Q4_K_M.gguf
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
## Format
|
| 85 |
+
|
| 86 |
+
Uses FunctionGemma's native format with `<escape>` delimiters:
|
| 87 |
+
|
| 88 |
+
```
|
| 89 |
+
<start_of_turn>user
|
| 90 |
+
Fix the typo in config.json
|
| 91 |
+
<end_of_turn>
|
| 92 |
+
<start_of_turn>model
|
| 93 |
+
<think>I need to find and read the config file first.</think>
|
| 94 |
+
<start_function_call>call:glob{pattern:<escape>**/config.json<escape>}<end_function_call>
|
| 95 |
+
<end_of_turn>
|
| 96 |
+
<start_of_turn>developer
|
| 97 |
+
<start_function_response>response:glob{stdout:<escape>src/config.json<escape>,stderr:<escape><escape>,exit_code:0}<end_function_response>
|
| 98 |
+
<end_of_turn>
|
| 99 |
+
...
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
## License
|
| 103 |
+
|
| 104 |
+
This model inherits the [Gemma license](https://ai.google.dev/gemma/terms) from the base model.
|
| 105 |
+
|
| 106 |
+
## Links
|
| 107 |
+
|
| 108 |
+
- Training script: [victor/llama-agent-training](https://huggingface.co/victor/llama-agent-training)
|
| 109 |
+
- Dataset: [victor/functiongemma-agent-sft](https://huggingface.co/datasets/victor/functiongemma-agent-sft)
|
| 110 |
+
- llama-agent: [github.com/ggml-org/llama.cpp/tools/agent](https://github.com/ggml-org/llama.cpp/tree/master/tools/agent)
|