Spaces:
Paused
Paused
Seungah Son
commited on
Commit
•
5ab40f9
1
Parent(s):
2914830
Update app.py
Browse files
app.py
CHANGED
@@ -3,9 +3,11 @@ from transformers import BertForQuestionAnswering
|
|
3 |
from transformers import BertTokenizerFast
|
4 |
import torch
|
5 |
from nltk.tokenize import word_tokenize
|
|
|
6 |
|
7 |
tokenizer = BertTokenizerFast.from_pretrained('bert-base-uncased')
|
8 |
-
model =
|
|
|
9 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
10 |
|
11 |
def get_prediction(context, question):
|
|
|
3 |
from transformers import BertTokenizerFast
|
4 |
import torch
|
5 |
from nltk.tokenize import word_tokenize
|
6 |
+
import timm
|
7 |
|
8 |
tokenizer = BertTokenizerFast.from_pretrained('bert-base-uncased')
|
9 |
+
model = timm.create_model('hf_hub:pseudolab/AI_Tutor_BERT', pretrained=True)
|
10 |
+
#model = BertForQuestionAnswering.from_pretrained("bert-base-uncased")
|
11 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
12 |
|
13 |
def get_prediction(context, question):
|