Downloads · 30 days
27
7% of all-time downloads
roger33303/gemma-2-9b-Instruct-Finetune-website-QnA
gemma-2-9b-Instruct-Finetune-website-QnA is a text generation model from roger33303. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a finetuned version of the Gemma-2-9b large language model, designed to provide precise and informative answers to questions related to university courses. It specializes in offering course details, incl…
Downloads · 30 days
27
7% of all-time downloads
All-time downloads
385
Public
Parameters
9.2B
74 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors18.5 GB · 100%
From the Hugging Face model README
This model is a finetuned version of the Gemma-2-9b large language model, designed to provide precise and informative answers to questions related to university courses. It specializes in offering course details, including fees, duration, and campus information, while linking users to the appropriate pages for further exploration. The model has been finetuned with a private dataset to ensure high-quality, domain-specific responses.
A private dataset was used to finetune this model. The dataset was meticulously created by web scraping course-related information from the University of Westminster website. The scraped data includes:
The data was cleaned, organized, and structured to enhance the model's performance in responding to domain-specific queries.
You can interact with the finetuned Gemma-2-9b model using the following Python code:
alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
{}
### Input:
{}
### Response:
{}"""
from transformers import TextStreamer
def chatml(question, model):
inputs = tokenizer([alpaca_prompt.format(question, "", "", )], return_tensors="pt").to("cuda")
text_streamer = TextStreamer(tokenizer, skip_special_tokens=True,
skip_prompt=True)
return model.generate(**inputs, streamer=text_streamer,
max_new_tokens=512,
do_sample=True,
temperature=0.9,
top_p=0.5,
top_k=20,
repetition_penalty=1.1,
eos_token_id=tokenizer.eos_token_id,
use_cache=True,
)
# Function call
question = "Which course is related to AI and Communication at westminster?"
x = chatml(question,model)
This script defines a custom chatml function to query the model using a formatted Alpaca-style prompt. Replace question with your query and model with your loaded Gemma-2-9b model instance to receive a response.