Downloads · 30 days
10
11% of all-time downloads
Mr-Vicky-01/Facebook-Bart-Qna
Facebook-Bart-Qna is a machine learning model from Mr-Vicky-01. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
- Developed by: Vicky - License: mit - Finetuned from model : Bart summarization
Downloads · 30 days
10
11% of all-time downloads
All-time downloads
93
Public
Parameters
406M
1.6 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors1.6 GB · 100%
From the Hugging Face model README
pip install transformers
# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("Mr-Vicky-01/Facebook-Bart-Qna")
model = AutoModelForSeq2SeqLM.from_pretrained("Mr-Vicky-01/Facebook-Bart-Qna")
def generate_answer(text):
inputs = tokenizer([text], return_tensors='pt', truncation=True)
summary_ids = model.generate(inputs['input_ids'], max_length=512)
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
return summary
text_to_summarize = """Please answer this question: What is Artifical Intelligence?"""
summary = generate_answer(text_to_summarize)
print(summary)