You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

Model name and description here

Gemma 2 2B-IT Fine-tuned for Question Answering

This model is a fine-tuned version of google/gemma-2-2b-it optimized for question answering tasks.

Model Details

  • Base model: google/gemma-2-2b-it
  • Fine-tuning method: LoRA (Low-Rank Adaptation)
  • BLEU Score: 0.0301
  • SacreBLEU Score: 4.4093

Usage

With Transformers

from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("QaiserShumail/gemma-2-qa-finetuned")
model = AutoModelForCausalLM.from_pretrained("QaiserShumail/gemma-2-qa-finetuned")

# Ask a question
question = "Your question here"
prompt = f"<start_of_turn>user\nAnswer this question: {question}<end_of_turn>\n<start_of_turn>model\n"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256)
answer = tokenizer.decode(outputs[0], skip_special_tokens=True)
answer = answer.split("<start_of_turn>model\n")[1].split("<end_of_turn>")[0]
print(answer)

With LM Studio

  1. Download LM Studio
  2. Add this model from Hugging Face Hub
  3. Run inference with the prompt format:
    <start_of_turn>user
    Answer this question: Your question here
    <end_of_turn>
    <start_of_turn>model
    
Downloads last month
-
Safetensors
Model size
2.61B params
Tensor type
F16
Inference Providers NEW
This model isn't deployed by any Inference Provider. 馃檵 Ask for provider support