Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,8 +6,9 @@ import numpy as np
|
|
6 |
|
7 |
# Load the model and tokenizer
|
8 |
def load_model():
|
9 |
-
tokenizer = BertTokenizer.from_pretrained('
|
10 |
-
|
|
|
11 |
model_state_dict = torch.load('sentiment7_model_acc8878.pth', map_location=torch.device('cpu')) # cpu 사용
|
12 |
model.load_state_dict(model_state_dict)
|
13 |
model.eval()
|
|
|
6 |
|
7 |
# Load the model and tokenizer
|
8 |
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('sentiment7_model_acc8878.pth', map_location=torch.device('cpu')) # cpu 사용
|
13 |
model.load_state_dict(model_state_dict)
|
14 |
model.eval()
|