Views
No views yet
unsloth/Llama-3.2-1B-Instructhttps://ollama.com/download.ollama --versionollama run mecha-org/linux-command-generator-llama3.2-1b1ollama run mecha-org/linux-command-generator-llama3.2-1b -p "Display the first 5 lines of access.log"
2# Expected: head -n 5 access.log1ollama run mecha-org/linux-command-generator-llama3.2-1b -p "Output only the command with no explanation. Show system information including kernel version"
2# Expected: uname -amodel.gguf, put it next to a Modelfile:FROM ./model.gguf
PARAMETER temperature 0.2
PARAMETER top_p 0.9
PARAMETER num_ctx 2048
SYSTEM You are a Linux command generator. Output only the command with no explanation.
TEMPLATE {{ .Prompt }}1ollama create linux-cmd-gen -f Modelfile
2ollama run linux-cmd-gen -p "Find all .py files recursively"
3# Expected: find . -name "*.py"1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4model_id = "mecha-org/linux-command-generator-llama3.2-1b"
5tokenizer = AutoTokenizer.from_pretrained(model_id)
6model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16 if torch.cuda.is_available() else None)
7
8def generate_command(description: str) -> str:
9 messages = [{"role": "user", "content": description}]
10 inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
11 if torch.cuda.is_available():
12 inputs = inputs.to(model.device)
13 model = model.to("cuda")
14 outputs = model.generate(input_ids=inputs, max_new_tokens=64)
15 return tokenizer.decode(outputs[0], skip_special_tokens=True)
16
17print(generate_command("List all files in the current directory with detailed information"))
18# -> ls -la1from unsloth import FastLanguageModel
2
3model_id = "mecha-org/linux-command-generator-llama3.2-1b"
4model, tokenizer = FastLanguageModel.from_pretrained(model_name=model_id, max_seq_length=2048)
5FastLanguageModel.for_inference(model)
6
7msgs = [{"role": "user", "content": "Compress the file data.txt using bzip2"}]
8inputs = tokenizer.apply_chat_template(msgs, tokenize=True, add_generation_prompt=True, return_tensors="pt")
9output = model.generate(input_ids=inputs, max_new_tokens=32)
10print(tokenizer.decode(output[0], skip_special_tokens=True))
11# -> bzip2 data.txtuname -afind . -name "*.py"head -n 5 access.logchmod +x script.shtar -cf backup.tar documents/{"input": "Describe what you want to do", "output": "linux_command_here"}unsloth/Llama-3.2-1B-Instructrm -rf /, mkfs, dd).llama.cpp and Ollama.@software{hrsvrn_linux_command_generator_llama32_1b,
author = {Harshvardhan Vatsa},
title = {Linux Command Generator (Llama 3.2 1B)},
year = {2025},
url = {https://huggingface.co/mecha-org/linux-command-generator-llama3.2-1b}
}unsloth/Llama-3.2-1B-Instructunsloth, transformers, trl, accelerate, bitsandbytes