Downloads · 30 days
17
25% of all-time downloads
Eng-Elias/qwen3-0.6b-terminal-instruct-lora
qwen3-0.6b-terminal-instruct-lora is a text generation model from Eng-Elias. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as cc-by-nc-sa-4.0.
This repository contains LoRA adapters for generating terminal commands from natural language instructions.
Downloads · 30 days
17
25% of all-time downloads
All-time downloads
68
Public
Repo size
66.6 MB
Likes
0
Public
Click a slice to open those files.
.safetensors18.4 MB · 54%
From the Hugging Face model README
This repository contains LoRA adapters for generating terminal commands from natural language instructions.
| Metric | Score |
|---|---|
| Exact Match Accuracy | ~93-97% |
| Fuzzy Match Accuracy | ~94-98% |
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load base model and apply LoRA adapters
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-0.6B")
model = PeftModel.from_pretrained(base_model, "Eng-Elias/qwen3-0.6b-terminal-instruct-lora")
tokenizer = AutoTokenizer.from_pretrained("Eng-Elias/qwen3-0.6b-terminal-instruct-lora")
# Generate command
def generate_command(instruction, os_tag="[LINUX]"):
prompt = f"### Instruction:\n{instruction}\n\n### Input:\n{os_tag}\n\n### Response:\n"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100, do_sample=False)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
return response.split("### Response:")[-1].strip()
# Example usage
print(generate_command("List all files including hidden ones", "[LINUX]"))
# Output: ls -a
The model can generate commands for various tasks including:
The model uses an Alpaca-style prompt format:
### Instruction:
{natural language description}
### Input:
{OS tag: [LINUX], [WINDOWS], [MAC], or JSON request}
### Response:
{generated command}
# Linux
generate_command("Show disk usage", "[LINUX]") # df -h
# Windows
generate_command("Show disk usage", "[WINDOWS]") # wmic logicaldisk get size,freespace
# macOS
generate_command("Show disk usage", "[MAC]") # df -h
generate_command("Delete file named temp.txt", "Return the command for all operating systems as JSON")
# {"description": "Delete file named temp.txt", "linux": "rm temp.txt", "windows": "del temp.txt", "mac": "rm temp.txt"}
Training metrics and hyperparameters are logged to Weights & Biases:
This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0).
You are free to:
Under the following terms:
Full license: https://creativecommons.org/licenses/by-nc-sa-4.0/legalcode
@misc{qwen3-terminal-instruct,
author = {Eng-Elias},
title = {Qwen3-0.6B Terminal Command Generator},
year = {2025},
publisher = {HuggingFace},
url = {https://huggingface.co/Eng-Elias/qwen3-0.6b-terminal-instruct-lora}
}