llama-2-7b-ftabhi / README.md
Abhishek0323's picture
Update README.md
9bc8cc0 verified
metadata
language:
  - en
tags:
  - llama
  - text-generation
  - fine-tuned
datasets:
  - mlabonne/guanaco-llama2-1k

Abhishek0323's Fine-tuned LLaMA-2 Model

Model Description

This model is a fine-tuned version of the LLaMA-2 language model specifically optimized for generating responses to general knowledge questions. It has been fine-tuned to better understand and process prompts in a conversational context.

How to Use

from transformers import AutoTokenizer, pipeline
import torch

model_name = "Abhishek0323/llama-2-7b-ftabhi"
prompt = "What is a large language model?"

tokenizer = AutoTokenizer.from_pretrained(model_name)
gen_pipeline = pipeline(
    "text-generation",
    model=model_name,
    torch_dtype=torch.float16,
    device_map="auto",
)

sequences = gen_pipeline(
    f'<s>[INST] {prompt} [/INST]',
    do_sample=True,
    top_k=10,
    num_return_sequences=1,
    eos_token_id=tokenizer.eos_token_id,
    max_length=200,
)

for ans in sequences:
    print(f"Result: {ans['generated_text']}")