"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "3488ef5a92b657846b30a2f197f692e2ec4ac2e1"
Unverified Commit 737bff6a authored by Arthur's avatar Arthur Committed by GitHub
Browse files

[FuturWarning] Add futur warning for LEDForSequenceClassification (#19066)



* fix led eos_mask

* add Futur Warning

* revert uselesss cahnges

* Update src/transformers/models/led/modeling_led.py
Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
parent 06d48806
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
import math import math
import random import random
import warnings
from dataclasses import dataclass from dataclasses import dataclass
from typing import List, Optional, Tuple, Union from typing import List, Optional, Tuple, Union
...@@ -2528,6 +2529,12 @@ class LEDForConditionalGeneration(LEDPreTrainedModel): ...@@ -2528,6 +2529,12 @@ class LEDForConditionalGeneration(LEDPreTrainedModel):
) )
class LEDForSequenceClassification(LEDPreTrainedModel): class LEDForSequenceClassification(LEDPreTrainedModel):
def __init__(self, config: LEDConfig, **kwargs): def __init__(self, config: LEDConfig, **kwargs):
warnings.warn(
"The `transformers.LEDForSequenceClassification` class is deprecated and will be removed in version 5 of"
" Transformers. No actual method were provided in the original paper on how to perfom"
" sequence classification.",
FutureWarning,
)
super().__init__(config, **kwargs) super().__init__(config, **kwargs)
self.led = LEDModel(config) self.led = LEDModel(config)
self.classification_head = LEDClassificationHead( self.classification_head = LEDClassificationHead(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment