Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ def load_model():
|
|
9 |
tokenizer = BertTokenizer.from_pretrained('beomi/kcbert-base')
|
10 |
config = BertConfig.from_pretrained('beomi/kcbert-base', num_labels=7)
|
11 |
model = BertForSequenceClassification.from_pretrained('beomi/kcbert-base', config=config)
|
12 |
-
model_state_dict = torch.load('
|
13 |
model.load_state_dict(model_state_dict)
|
14 |
model.eval()
|
15 |
return model, tokenizer
|
|
|
9 |
tokenizer = BertTokenizer.from_pretrained('beomi/kcbert-base')
|
10 |
config = BertConfig.from_pretrained('beomi/kcbert-base', num_labels=7)
|
11 |
model = BertForSequenceClassification.from_pretrained('beomi/kcbert-base', config=config)
|
12 |
+
model_state_dict = torch.load('YEINJEONG/sentiment7', map_location=torch.device('cpu')) # cpu 사용
|
13 |
model.load_state_dict(model_state_dict)
|
14 |
model.eval()
|
15 |
return model, tokenizer
|