vakodiya commited on
Commit
01a0479
1 Parent(s): 47c3535

Update generate_answer.py

Browse files
Files changed (1) hide show
  1. generate_answer.py +3 -3
generate_answer.py CHANGED
@@ -1,8 +1,8 @@
1
- from transformers import BartTokenizer, BartModel
2
  from langchain.prompts import PromptTemplate
3
 
4
- tokenizer = BartTokenizer.from_pretrained('facebook/bart-base')
5
- model = BartModel.from_pretrained('facebook/bart-base')
6
 
7
  def generate_answer(context):
8
  prompt_template = PromptTemplate(template="Summarise the following context: {context}",
 
1
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
2
  from langchain.prompts import PromptTemplate
3
 
4
+ tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large-cnn")
5
+ model = AutoModelForSeq2SeqLM.from_pretrained("facebook/bart-large-cnn")
6
 
7
  def generate_answer(context):
8
  prompt_template = PromptTemplate(template="Summarise the following context: {context}",