jonghhhh commited on
Commit
8ad1ab7
1 Parent(s): ee67e00

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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('bert-base-uncased')
10
- model = BertForSequenceClassification.from_pretrained('bert-base-uncased', num_labels=7)
 
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()