Kirill
commited on
Commit
·
4b521ba
1
Parent(s):
fe5559c
fix load model
Browse files
app.py
CHANGED
|
@@ -30,7 +30,7 @@ id_to_description = load_tags_info()
|
|
| 30 |
def load_model():
|
| 31 |
config = DistilBertConfig.from_json_file('./config.json')
|
| 32 |
model = DistilBertForSequenceClassification(config)
|
| 33 |
-
state_dict = torch.load('./pytorch_model.bin')
|
| 34 |
model.load_state_dict(state_dict)
|
| 35 |
return model
|
| 36 |
|
|
|
|
| 30 |
def load_model():
|
| 31 |
config = DistilBertConfig.from_json_file('./config.json')
|
| 32 |
model = DistilBertForSequenceClassification(config)
|
| 33 |
+
state_dict = torch.load('./pytorch_model.bin', map_location=torch.device('cpu'))
|
| 34 |
model.load_state_dict(state_dict)
|
| 35 |
return model
|
| 36 |
|