Downloads · 30 days
3
1% of all-time downloads
ShahDhruv/distillgpt2_accountant
distillgpt2_accountant is a question answering model from ShahDhruv. Use it when the input is a question plus a passage. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
3
1% of all-time downloads
All-time downloads
310
Public
Parameters
81.9M
328 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors328 MB · 99%
From the Hugging Face model README
Welcome to the Fine-Tuned GPT-2 QA Model! This model is a specialized version of GPT-2, fine-tuned on a high-quality question-answering dataset to provide accurate and concise answers to a wide range of questions. Whether you're building a chatbot, a knowledge base, or an interactive QA system, this model is designed to deliver reliable responses with the power of the Hugging Face transformers library.
🔑 Key Features:
Get started with this model in just a few lines of code! Below is an example of how to load the model and tokenizer using the transformers library and perform question answering.
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("ShahDhruv/distillgpt2_accountant")
model = AutoModelForCausalLM.from_pretrained("ShahDhruv/distillgpt2_accountant")
question = "What is double-entry bookkeeping?"
input_text = f"Question: {question}\nAnswer: "
inputs = tokenizer(input_text, return_tensors="pt")
# Generate answer
outputs = model.generate(
**inputs,
max_length=200,
num_return_sequences=1,
do_sample=True,
temperature=0.4,
top_k=40,
top_p=0.95,
repetition_penalty=1.2,
min_length = 50,
length_penalty = 1.2
)
answer = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(answer)