Spaces:
Paused
Paused
Update generate_answer.py
Browse files- generate_answer.py +3 -3
generate_answer.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
from transformers import
|
2 |
from langchain.prompts import PromptTemplate
|
3 |
|
4 |
-
tokenizer =
|
5 |
-
model =
|
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}",
|