Update custom_model_package/custom_model.py
Browse files
custom_model_package/custom_model.py
CHANGED
@@ -56,8 +56,7 @@ class CustomModel(XLMRobertaForSequenceClassification):
|
|
56 |
if config is None:
|
57 |
config = AutoConfig.from_pretrained(pretrained_model_name_or_path, **kwargs)
|
58 |
num_emotion_labels = kwargs.pop('num_emotion_labels', config.num_emotion_labels)
|
59 |
-
model = super(CustomModel, cls).from_pretrained(pretrained_model_name_or_path, config=config, *model_args, **kwargs)
|
60 |
-
model.num_emotion_labels = num_emotion_labels
|
61 |
return model
|
62 |
|
63 |
# Register the custom configuration and model
|
|
|
56 |
if config is None:
|
57 |
config = AutoConfig.from_pretrained(pretrained_model_name_or_path, **kwargs)
|
58 |
num_emotion_labels = kwargs.pop('num_emotion_labels', config.num_emotion_labels)
|
59 |
+
model = super(CustomModel, cls).from_pretrained(pretrained_model_name_or_path, config=config, num_emotion_labels=num_emotion_labels, *model_args, **kwargs)
|
|
|
60 |
return model
|
61 |
|
62 |
# Register the custom configuration and model
|