Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,15 +5,12 @@ from transformers import AutoTokenizer, AutoModelForQuestionAnswering
|
|
| 5 |
|
| 6 |
tokenizer = AutoTokenizer.from_pretrained("rsvp-ai/bertserini-bert-large-squad")
|
| 7 |
|
| 8 |
-
model =
|
| 9 |
|
| 10 |
import torch
|
| 11 |
|
| 12 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
| 13 |
|
| 14 |
-
tokenizer = AutoTokenizer.from_pretrained('jaimin/bert-large-squad')
|
| 15 |
-
model = AutoModelForQuestionAnswering.from_pretrained('jaimin/bert-large-squad').to(device)
|
| 16 |
-
|
| 17 |
def get_answer(question,context,device="cpu"):
|
| 18 |
|
| 19 |
question_doc = "question: {} context: {}".format(question, context)
|
|
|
|
| 5 |
|
| 6 |
tokenizer = AutoTokenizer.from_pretrained("rsvp-ai/bertserini-bert-large-squad")
|
| 7 |
|
| 8 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("rsvp-ai/bertserini-bert-large-squad")
|
| 9 |
|
| 10 |
import torch
|
| 11 |
|
| 12 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
| 13 |
|
|
|
|
|
|
|
|
|
|
| 14 |
def get_answer(question,context,device="cpu"):
|
| 15 |
|
| 16 |
question_doc = "question: {} context: {}".format(question, context)
|