Instructions to use EzioDevio/gemma4-dev-agent with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EzioDevio/gemma4-dev-agent with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("EzioDevio/gemma4-dev-agent", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download scripts/generate_dataset.py from EzioDevio/gemma4-dev-agent: direct link, hf CLI and curl.
- Browser
- Download file 3.06 kB
-
https://huggingface.co/EzioDevio/gemma4-dev-agent/resolve/main/scripts/generate_dataset.py
- Command line
-
hf download hf://EzioDevio/gemma4-dev-agent/scripts/generate_dataset.py
-
curl -L -o generate_dataset.py https://huggingface.co/EzioDevio/gemma4-dev-agent/resolve/main/scripts/generate_dataset.py
3.06 kB
| """ | |
| Synthetic Trajectory Generator for Gemma Fine-Tuning. | |
| Generates multi-step tool execution sequences for agent training. | |
| """ | |
| import json | |
| from pathlib import Path | |
| def create_full_trajectory(symbol: str, file_path: str, bug_desc: str) -> dict: | |
| return { | |
| "messages": [ | |
| { | |
| "role": "user", | |
| "content": f"Investigate and resolve issue in symbol '{symbol}': {bug_desc}" | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": None, | |
| "tool_calls": [ | |
| { | |
| "type": "function", | |
| "function": { | |
| "name": "code_graph_search", | |
| "parameters": {"symbol_name": symbol} | |
| } | |
| } | |
| ] | |
| }, | |
| { | |
| "role": "tool", | |
| "content": json.dumps({ | |
| "status": "success", | |
| "query": symbol, | |
| "definitions": [{"file": file_path, "type": "class", "lineno": 10}] | |
| }) | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": None, | |
| "tool_calls": [ | |
| { | |
| "type": "function", | |
| "function": { | |
| "name": "read_scope", | |
| "parameters": {"file_path": file_path, "start_line": 10, "end_line": 35} | |
| } | |
| } | |
| ] | |
| }, | |
| { | |
| "role": "tool", | |
| "content": json.dumps({ | |
| "status": "success", | |
| "file_path": file_path, | |
| "content": "def execute(self):\n pass\n" | |
| }) | |
| }, | |
| { | |
| "role": "assistant", | |
| "content": f"Located `{symbol}` in `{file_path}`. Verified scope and ready for resolution." | |
| } | |
| ] | |
| } | |
| def main(): | |
| output_path = Path("data/train_trajectories.jsonl") | |
| output_path.parent.mkdir(parents=True, exist_ok=True) | |
| samples = [ | |
| create_full_trajectory("FileOperations", "src/tools/file_ops.py", "Boundary check validation failure."), | |
| create_full_trajectory("RepositoryASTParser", "src/tools/ast_parser.py", "AST scope extraction missing line bounds."), | |
| create_full_trajectory("CodeGraphIndexer", "src/tools/code_graph.py", "Symbol indexing cache invalidation issue."), | |
| create_full_trajectory("PyTestExecutor", "src/tools/executor.py", "Subprocess execution timeout handling."), | |
| create_full_trajectory("ContextCompactor", "src/agent/compactor.py", "Token limit calculation drift.") | |
| ] | |
| with open(output_path, "w", encoding="utf-8") as f: | |
| for sample in samples: | |
| f.write(json.dumps(sample) + "\n") | |
| print(f"Generated {len(samples)} multi-step training trajectories at {output_path}") | |
| if __name__ == "__main__": | |
| main() | |