Upload sentiment classifier trained on Amazon Reviews
Browse files
configuration_sentiment.py
CHANGED
|
@@ -28,6 +28,13 @@ class SentimentClassifierConfig(PretrainedConfig):
|
|
| 28 |
|
| 29 |
model_type = "sentiment-classifier"
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
def __init__(
|
| 32 |
self,
|
| 33 |
pretrained_model: str = "xlm-roberta-base",
|
|
|
|
| 28 |
|
| 29 |
model_type = "sentiment-classifier"
|
| 30 |
|
| 31 |
+
# Enable trust_remote_code by mapping to the custom classes
|
| 32 |
+
# This tells HuggingFace where to find the custom model and config classes
|
| 33 |
+
auto_map = {
|
| 34 |
+
"AutoConfig": "configuration_sentiment.SentimentClassifierConfig",
|
| 35 |
+
"AutoModelForSequenceClassification": "sentiment_classifier.SentimentClassifier",
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
def __init__(
|
| 39 |
self,
|
| 40 |
pretrained_model: str = "xlm-roberta-base",
|