Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,8 @@ from transformers import DistilBertForQuestionAnswering, DistilBertConfig, Disti
|
|
2 |
import torch
|
3 |
|
4 |
model = DistilBertForQuestionAnswering(DistilBertConfig.from_pretrained('distilbert/distilbert-base-multilingual-cased')).to("cpu")
|
5 |
-
st_dict = torch.load("QazDistilBERT.pt")
|
6 |
-
model.load_state_dict(st_dict
|
7 |
tokenizer = DistilBertTokenizerFast.from_pretrained("dappyx/QazDistilbertFast-tokenizerV3")
|
8 |
|
9 |
import gradio as gr
|
|
|
2 |
import torch
|
3 |
|
4 |
model = DistilBertForQuestionAnswering(DistilBertConfig.from_pretrained('distilbert/distilbert-base-multilingual-cased')).to("cpu")
|
5 |
+
st_dict = torch.load("QazDistilBERT.pt",map_location=torch.device('cpu'))
|
6 |
+
model.load_state_dict(st_dict)
|
7 |
tokenizer = DistilBertTokenizerFast.from_pretrained("dappyx/QazDistilbertFast-tokenizerV3")
|
8 |
|
9 |
import gradio as gr
|