Skip to content

Commit

Permalink
refactor: minor formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnatovFedor committed May 18, 2023
1 parent 1ec591b commit 567b7d2
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 71 deletions.
2 changes: 1 addition & 1 deletion deeppavlov/configs/classifiers/glue/glue_cola_roberta.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,4 @@
}
]
}
}
}
85 changes: 21 additions & 64 deletions deeppavlov/configs/classifiers/glue/glue_mrpc_roberta.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,57 +9,34 @@
},
"dataset_iterator": {
"class_name": "huggingface_dataset_iterator",
"features": [
"sentence1",
"sentence2"
],
"features": ["sentence1", "sentence2"],
"label": "label",
"seed": 42
},
"chainer": {
"in": [
"sentence1",
"sentence2"
],
"in_y": [
"y"
],
"in": ["sentence1", "sentence2"],
"in_y": ["y"],
"pipe": [
{
"class_name": "torch_transformers_preprocessor",
"vocab_file": "{BASE_MODEL}",
"do_lower_case": false,
"max_seq_length": 256,
"in": [
"sentence1",
"sentence2"
],
"out": [
"bert_features"
]
"in": ["sentence1", "sentence2"],
"out": ["bert_features"]
},
{
"id": "classes_vocab",
"class_name": "simple_vocab",
"fit_on": [
"y"
],
"fit_on": ["y"],
"save_path": "{MODEL_PATH}/classes.dict",
"load_path": "{MODEL_PATH}/classes.dict",
"in": [
"y"
],
"out": [
"y_ids"
]
"in": ["y"],
"out": ["y_ids"]
},
{
"in": [
"y_ids"
],
"out": [
"y_onehot"
],
"in": ["y_ids"],
"out": ["y_onehot"],
"class_name": "one_hotter",
"depth": "#classes_vocab.len",
"single_vector": true
Expand All @@ -77,52 +54,32 @@
},
"learning_rate_drop_patience": 3,
"learning_rate_drop_div": 2.0,
"in": [
"bert_features"
],
"in_y": [
"y_ids"
],
"out": [
"y_pred_probas"
]
"in": ["bert_features"],
"in_y": ["y_ids"],
"out": ["y_pred_probas"]
},
{
"in": [
"y_pred_probas"
],
"out": [
"y_pred_ids"
],
"in": ["y_pred_probas"],
"out": ["y_pred_ids"],
"class_name": "proba2labels",
"max_proba": true
},
{
"in": [
"y_pred_ids"
],
"out": [
"y_pred_labels"
],
"in": ["y_pred_ids"],
"out": ["y_pred_labels"],
"ref": "classes_vocab"
}
],
"out": [
"y_pred_labels"
]
"out": ["y_pred_labels"]
},
"train": {
"batch_size": 4,
"metrics": [
"accuracy"
],
"metrics": ["accuracy"],
"epochs": 2,
"val_every_n_epochs": 1,
"log_every_n_epochs": 1,
"show_examples": false,
"evaluation_targets": [
"valid"
],
"evaluation_targets": ["valid"],
"class_name": "torch_trainer",
"tensorboard_log_dir": "{MODEL_PATH}/",
"pytest_max_batches": 2
Expand All @@ -144,4 +101,4 @@
}
]
}
}
}
2 changes: 1 addition & 1 deletion deeppavlov/configs/classifiers/glue/glue_qnli_roberta.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@
}
]
}
}
}
2 changes: 1 addition & 1 deletion deeppavlov/configs/classifiers/glue/glue_qqp_roberta.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@
}
]
}
}
}
2 changes: 1 addition & 1 deletion deeppavlov/configs/classifiers/glue/glue_sst2_roberta.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,4 @@
}
]
}
}
}
2 changes: 1 addition & 1 deletion deeppavlov/configs/classifiers/glue/glue_stsb_roberta.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@
}
]
}
}
}
4 changes: 2 additions & 2 deletions tests/test_quick_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@
("classifiers/rusentiment_bert.json", "classifiers", ('IP',)): [ONE_ARGUMENT_INFER_CHECK],
("classifiers/sentiment_twitter.json", "classifiers", ALL_MODES): [ONE_ARGUMENT_INFER_CHECK],
("classifiers/sentiment_sst_conv_bert.json", "classifiers", ('IP',)): [ONE_ARGUMENT_INFER_CHECK],
("classifiers/glue/glue_mrpc_cased_bert_torch.json", "classifiers", ('TI',)): [TWO_ARGUMENTS_INFER_CHECK],
("classifiers/glue/glue_stsb_cased_bert_torch.json", "classifiers", ('TI',)): [TWO_ARGUMENTS_INFER_CHECK],
("classifiers/glue/glue_mrpc_roberta.json", "classifiers", ('TI',)): [TWO_ARGUMENTS_INFER_CHECK],
("classifiers/glue/glue_stsb_roberta.json", "classifiers", ('TI',)): [TWO_ARGUMENTS_INFER_CHECK],
("classifiers/glue/glue_mnli_roberta.json", "classifiers", ('TI',)): [TWO_ARGUMENTS_INFER_CHECK],
("classifiers/glue/glue_rte_roberta_mnli.json", "classifiers", ('TI',)): [TWO_ARGUMENTS_INFER_CHECK],
("classifiers/superglue/superglue_copa_roberta.json", "classifiers", ('TI',)): [LIST_ARGUMENTS_INFER_CHECK],
Expand Down

0 comments on commit 567b7d2

Please sign in to comment.