Downloads · 30 days
0
azherali/Qwen-Instruct_Finetune_For_Docker_Commands
Qwen-Instruct_Finetune_For_Docker_Commands is a machine learning model from azherali. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
This model is a fine-tuned version of Qwen/Qwen2.5-1.5B-Instruct, trained on the dockerNLcommands dataset. It specializes in converting natural-language instructions into accurate and efficient Docker commands. The fi…
Downloads · 30 days
0
Access
Public
Updated Nov 15, 2025
Repo size
11.4 MB
Likes
0
Public
Click a slice to open those files.
.json14.2 MB · 89%
From the Hugging Face model README
This model is a fine-tuned version of Qwen/Qwen2.5-1.5B-Instruct, trained on the dockerNLcommands dataset. It specializes in converting natural-language instructions into accurate and efficient Docker commands. The fine-tuning process enhances the model’s ability to understand real-world Docker workflows, making it useful for developers, DevOps engineers, and anyone working with containerized environments.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "azherali/Qwen-Instruct_Finetune_For_Docker_Commands"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
# List all containers with Ubuntu as their ancestor.
# docker ps --filter 'ancestor=ubuntu'
prompt = "List all containers with Ubuntu as their ancestor."
messages = [
{"role": "system", "content": "translate this sentence in docker command"},
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=512
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
This model was trained with SFT.