sabersol commited on
Commit
f80494f
·
1 Parent(s): 44ec4e6

model updated

Browse files
Files changed (3) hide show
  1. config.json +8 -20
  2. finetune-emotions.py +3 -2
  3. pytorch_model.bin +1 -1
config.json CHANGED
@@ -8,26 +8,14 @@
8
  "hidden_act": "gelu",
9
  "hidden_dropout_prob": 0.1,
10
  "hidden_size": 768,
11
- "id2label": [
12
- {
13
- "0": "sadness"
14
- },
15
- {
16
- "1": "joy"
17
- },
18
- {
19
- "2": "love"
20
- },
21
- {
22
- "3": "anger"
23
- },
24
- {
25
- "4": "fear"
26
- },
27
- {
28
- "5": "surprise"
29
- }
30
- ],
31
  "initializer_range": 0.02,
32
  "intermediate_size": 3072,
33
  "label2id": {
 
8
  "hidden_act": "gelu",
9
  "hidden_dropout_prob": 0.1,
10
  "hidden_size": 768,
11
+ "id2label": {
12
+ "0": "sadness",
13
+ "1": "joy",
14
+ "2": "love",
15
+ "3": "anger",
16
+ "4": "fear",
17
+ "5": "surprise"
18
+ },
 
 
 
 
 
 
 
 
 
 
 
 
19
  "initializer_range": 0.02,
20
  "intermediate_size": 3072,
21
  "label2id": {
finetune-emotions.py CHANGED
@@ -28,11 +28,12 @@ def get_encoded_data(tokenizer):
28
  return emotions_encoded
29
 
30
  if __name__ == "__main__":
31
- labels = ['sadness', 'joy', 'love', 'anger', 'fear', 'surprise']
 
32
  model = AutoModelForSequenceClassification.from_pretrained(
33
  pretrained_model_name_or_path = BASE_MODEL_NAME,
34
  num_labels = len(labels),
35
- id2label=[{i: labels[i]} for i in range(len(labels))],
36
  resume_download=True,).to(device)
37
 
38
  tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL_NAME)
 
28
  return emotions_encoded
29
 
30
  if __name__ == "__main__":
31
+ id2label = {0: 'sadness', 1: 'joy', 2: 'love', 3: 'anger', 4: 'fear', 5: 'surprise'}
32
+ labels = list(id2label.values())
33
  model = AutoModelForSequenceClassification.from_pretrained(
34
  pretrained_model_name_or_path = BASE_MODEL_NAME,
35
  num_labels = len(labels),
36
+ id2label = id2label,
37
  resume_download=True,).to(device)
38
 
39
  tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL_NAME)
pytorch_model.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8b0409f66d9c3fe0e3aa9976265fa1f26dbd1526cd212a696fa8d97e459b71e9
3
  size 438036351
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:416c31214cc859ad412b651c4bee2b72ca1dcb3801a53e780d4daeb5e126502f
3
  size 438036351