Downloads · 30 days
10
12% of all-time downloads
sriauraworx/GK-Model-150M
GK-Model-150M is a question answering model from sriauraworx. Use it when the input is a question plus a passage. It is set up for transformers. The card lists the license as mit.
This model was trained from scratch by AuraWorx as a demonstration of building a small, yet capable, general knowledge question-answering model using Google Colab and modern training techniques.
Downloads · 30 days
10
12% of all-time downloads
All-time downloads
81
Public
Repo size
1.7 GB
Likes
0
Public
Click a slice to open those files.
.pt1.7 GB · 100%
From the Hugging Face model README
This model was trained from scratch by AuraWorx as a demonstration of building a small, yet capable, general knowledge question-answering model using Google Colab and modern training techniques.
This model is designed for general knowledge question-answering. You can load it using the Hugging Face transformers library:
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "your-username/GK-Model-150M" # Replace with your actual repo name
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
def ask_question(question, model, tokenizer, max_new_tokens=256):
input_text = f"Question: {question}
Answer: "
inputs = tokenizer(input_text, return_tensors="pt", return_attention_mask=True)
input_ids = inputs["input_ids"]
attention_mask = inputs["attention_mask"]
output_sequences = model.generate(
input_ids=input_ids,
attention_mask=attention_mask,
max_new_tokens=max_new_tokens,
pad_token_id=tokenizer.eos_token_id,
temperature=0.7,
top_k=50,
top_p=0.9,
repetition_penalty=1.15,
do_sample=True,
)
generated_text = tokenizer.decode(output_sequences[0], skip_special_tokens=True)
# Extracting only the answer part
answer_start = generated_text.find("Answer:") + len("Answer:")
answer = generated_text[answer_start:].strip()
return answer
question = "What is the capital of France?"
answer = ask_question(question, model, tokenizer)
print(f"Q: {question}")
print(f"A: {answer}")
question = "Who developed the theory of relativity?"
answer = ask_question(question, model, tokenizer)
print(f"Q: {question}")
print(f"A: {answer}")
This model was trained in a multi-stage process:
Developed by AuraWorx using resources from Google Colab and datasets from Hugging Face.
AuraWorx - Innovating AI Solutions