Downloads · 30 days
9
18% of all-time downloads
potteryrage/bashgemma-270m
bashgemma-270m is a text generation model from potteryrage. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
Fine-tuned FunctionGemma 270M for natural language to bash command translation.
Downloads · 30 days
9
18% of all-time downloads
All-time downloads
51
Public
Repo size
10.8 GB
Likes
1
Public
Click a slice to open those files.
.pt7.2 GB · 54%
From the Hugging Face model README
Fine-tuned FunctionGemma 270M for natural language to bash command translation.
Paper: Zenodo DOI: 10.5281/zenodo.18058613
BashGemma translates natural language queries into structured JSON tool calls representing bash commands. It achieves 57.4% NLC2CMD accuracy on NL2Bash test data—a 52.9 percentage point improvement over the base FunctionGemma model.
| Metric | Baseline | BashGemma |
|---|---|---|
| NLC2CMD Accuracy | 0.045 | 0.574 |
| Utility Match | 0.000 | 0.595 |
| Parse Rate | 0.000 | 0.995 |
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load model
base_model = AutoModelForCausalLM.from_pretrained(
"unsloth/functiongemma-270m-it",
torch_dtype=torch.float32,
)
model = PeftModel.from_pretrained(base_model, "thinkthink-dev/bashgemma-270m")
tokenizer = AutoTokenizer.from_pretrained("thinkthink-dev/bashgemma-270m")
# Generate
prompt = "<start_of_turn>user\nFind all Python files in the current directory<end_of_turn>\n<start_of_turn>model\n"
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=150, do_sample=False)
print(tokenizer.decode(outputs[0], skip_special_tokens=False))
# {"name": "find", "arguments": {"name": "'*.py'", "path": "."}}
Strong performance on:
find with name, type, size, mtime filtersgrep, ls, cat, wc, sortLimitations:
rsync, tar, etc.)@software{large2024bashgemma,
author = {Large, Jack},
title = {BashGemma: Fine-tuning a 270M Parameter Model for Natural Language to Bash Translation},
year = {2024},
publisher = {Zenodo},
doi = {10.5281/zenodo.18058613},
url = {https://zenodo.org/records/18058613}
}
Apache 2.0 (same as base Gemma model)