CoolFace
Modelpublic

tiam4tt/TinyLlama-1.1B-chat.v1.0-linux-qna

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes3downloads
Model Card

Model Details

Model Description

TinyLlama-Linux-QA is a specialized question-answering model designed to handle Linux-related queries. It is based on the TinyLlama architecture and has been fine-tuned on a dataset of Linux questions and answers using Unsloth.

Model Sources

Uses

python
from unsloth import FastLanguageModel
model_name = "tiam4tt/TinyLlama-1.1B-chat.v1.0-linux-qna"
model, tokenizer = FastLanguageModel.from_pretrained(
            model_name=model_name,
            max_seq_length=256,
            dtype=None, # Use None for automatic dtype detection
            load_in_4bit=True,
        )
        # Enable the model for inference
        FastLanguageModel.for_inference(model)

PROMPT = """Below is a question relating to the Linux operating system, paired with a paragraph describing further context. Write a short, simple, concise, and comprehensive response to the question.
### Question
{}
### Context
{}
### Response
{}"""

question = "How do I check the disk usage of a directory in Linux?"

inputs = tokenizer(PROMPT.format(
    question,
    "",
    "" # Leave blank for generation
    ),
    return_tensors="pt").to(model.device)
output = model.generate(
            **inputs,
            max_new_tokens=256,
            do_sample=True,
            temperature=1.0,
            top_p=0.9
        )
answer = tokenizer.decode(output[0], skip_special_tokens=True)
print(answer)

Framework versions

  • —PEFT 0.15.2