Text Classification
Transformers
Safetensors
English
emcoder
emotion-recognition
bayesian-deep-learning
mc-dropout
uncertainty-quantification
multi-label-classification
custom_code
Eval Results (legacy)
Instructions to use yezdata/EmCoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yezdata/EmCoder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="yezdata/EmCoder", trust_remote_code=True)# Load model directly from transformers import AutoModelForSequenceClassification model = AutoModelForSequenceClassification.from_pretrained("yezdata/EmCoder", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
fix self.config.return_dict
Browse files- modeling_emcoder.py +2 -2
modeling_emcoder.py
CHANGED
|
@@ -200,7 +200,7 @@ class EmCoder(PreTrainedModel):
|
|
| 200 |
Returns:
|
| 201 |
Logits of shape (n_samples, B, num_labels).
|
| 202 |
"""
|
| 203 |
-
return_dict = return_dict if return_dict is not None else
|
| 204 |
|
| 205 |
x = input_ids if input_ids is not None else kwargs.get("x")
|
| 206 |
mask = attention_mask if attention_mask is not None else kwargs.get("mask")
|
|
@@ -264,7 +264,7 @@ class EmCoder(PreTrainedModel):
|
|
| 264 |
**kwargs,
|
| 265 |
) -> tuple[torch.Tensor, ...] | SequenceClassifierOutput:
|
| 266 |
"""Standard forward pass without MC Dropout."""
|
| 267 |
-
return_dict = return_dict if return_dict is not None else
|
| 268 |
|
| 269 |
x = input_ids if input_ids is not None else kwargs.get("x")
|
| 270 |
mask = attention_mask if attention_mask is not None else kwargs.get("mask")
|
|
|
|
| 200 |
Returns:
|
| 201 |
Logits of shape (n_samples, B, num_labels).
|
| 202 |
"""
|
| 203 |
+
return_dict = return_dict if return_dict is not None else True
|
| 204 |
|
| 205 |
x = input_ids if input_ids is not None else kwargs.get("x")
|
| 206 |
mask = attention_mask if attention_mask is not None else kwargs.get("mask")
|
|
|
|
| 264 |
**kwargs,
|
| 265 |
) -> tuple[torch.Tensor, ...] | SequenceClassifierOutput:
|
| 266 |
"""Standard forward pass without MC Dropout."""
|
| 267 |
+
return_dict = return_dict if return_dict is not None else True
|
| 268 |
|
| 269 |
x = input_ids if input_ids is not None else kwargs.get("x")
|
| 270 |
mask = attention_mask if attention_mask is not None else kwargs.get("mask")
|