How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="Bruce1489/Llama3.2-docker-command-v2")
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages)
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("Bruce1489/Llama3.2-docker-command-v2")
model = AutoModelForCausalLM.from_pretrained("Bruce1489/Llama3.2-docker-command-v2")
messages = [
    {"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
	messages,
	add_generation_prompt=True,
	tokenize=True,
	return_dict=True,
	return_tensors="pt",
).to(model.device)

outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
Quick Links

Model Card for Model ID

I fine-tuned the "meta-llama/Llama-3.2-1B-Instruct" model using the QLoRA technique.

The resulting model can generate Docker commands based on given statements.

  • Developed by: Bruce1489(정성훈, Bruce Jung)
  • License: mit
  • Finetuned from model [optional]: meta-llama/Llama-3.2-1B-Instruct

Direct Use

import torch
from transformers import pipeline

pipe = pipeline(
    "text-generation",
    model="Bruce1489/Llama3.2-docker-command-v2",
    torch_dtype=torch.bfloat16,
    device_map="auto"
)
messages = [
    {"role": "system", "content": "translate this sentence in docker command"},
    {"role": "user", "content": "Please show me the Docker containers that have exited and are related to the mongo image."},
]

outputs = pipe(
    messages,
    max_new_tokens=256,
    temperature = 0.5,
    top_p  = 0.9,
    top_k = 10,
    do_sample = True,
    repetition_penalty = 1.2
)
print(outputs[0]["generated_text"][-1]['content'])
Downloads last month
3
Safetensors
Model size
1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train Bruce1489/Llama3.2-docker-command-v2