This commit is contained in:
Lysandre 2024-05-09 14:49:46 +02:00
parent 09830ffdd5
commit e179280a11
903 changed files with 1814 additions and 3171 deletions

View File

@ -53,7 +53,6 @@ quality:
@python -c "from transformers import *" || (echo '🚨 import failed, this means you introduced unprotected imports! 🚨'; exit 1)
ruff check $(check_dirs) setup.py conftest.py
ruff format --check $(check_dirs) setup.py conftest.py
python utils/custom_init_isort.py --check_only
python utils/sort_auto_mappings.py --check_only
python utils/check_doc_toc.py
@ -61,7 +60,6 @@ quality:
# Format source code automatically and check is there are any problems left that need manual fixing
extra_style_checks:
python utils/custom_init_isort.py
python utils/sort_auto_mappings.py
python utils/check_doc_toc.py --fix_and_overwrite

View File

@ -244,9 +244,7 @@ class DataTrainingArguments:
)
image_square_size: Optional[int] = field(
default=600,
metadata={
"help": "Image longest size will be resized to this value, then image will be padded to square."
},
metadata={"help": "Image longest size will be resized to this value, then image will be padded to square."},
)
max_train_samples: Optional[int] = field(
default=None,

View File

@ -260,7 +260,15 @@ extras["ja"] = deps_list("fugashi", "ipadic", "unidic_lite", "unidic", "sudachip
extras["sklearn"] = deps_list("scikit-learn")
extras["tf"] = deps_list("tensorflow", "onnxconverter-common", "tf2onnx", "tensorflow-text", "keras-nlp")
extras["tf-cpu"] = deps_list("keras", "tensorflow-cpu", "onnxconverter-common", "tf2onnx", "tensorflow-text", "keras-nlp", "tensorflow-probability")
extras["tf-cpu"] = deps_list(
"keras",
"tensorflow-cpu",
"onnxconverter-common",
"tf2onnx",
"tensorflow-text",
"keras-nlp",
"tensorflow-probability",
)
extras["torch"] = deps_list("torch", "accelerate")
extras["accelerate"] = deps_list("accelerate")
@ -380,12 +388,7 @@ extras["dev-tensorflow"] = (
+ extras["tf-speech"]
)
extras["dev"] = (
extras["all"]
+ extras["testing"]
+ extras["quality"]
+ extras["ja"]
+ extras["sklearn"]
+ extras["modelcreation"]
extras["all"] + extras["testing"] + extras["quality"] + extras["ja"] + extras["sklearn"] + extras["modelcreation"]
)
extras["torchhub"] = deps_list(
@ -470,4 +473,4 @@ extras["tests_examples_torch"] = deps_list()
extras["tests_examples_tf"] = deps_list()
extras["tests_custom_tokenizers"] = deps_list()
extras["tests_exotic_models"] = deps_list()
extras["consistency"] = deps_list()
extras["consistency"] = deps_list()

View File

@ -1168,7 +1168,9 @@ try:
except OptionalDependencyNotAvailable:
from .utils import dummy_torch_objects
_import_structure["utils.dummy_torch_objects"] = [name for name in dir(dummy_torch_objects) if not name.startswith("_")]
_import_structure["utils.dummy_torch_objects"] = [
name for name in dir(dummy_torch_objects) if not name.startswith("_")
]
else:
_import_structure["activations"] = []
_import_structure["benchmark.benchmark"] = ["PyTorchBenchmark"]

View File

@ -168,7 +168,5 @@ class AlbertOnnxConfig(OnnxConfig):
]
)
__all__ = [
"AlbertConfig",
"AlbertOnnxConfig"
]
__all__ = ["AlbertConfig", "AlbertOnnxConfig"]

View File

@ -1393,6 +1393,7 @@ class AlbertForMultipleChoice(AlbertPreTrainedModel):
attentions=outputs.attentions,
)
__all__ = [
"load_tf_weights_in_albert",
"AlbertPreTrainedModel",
@ -1402,5 +1403,5 @@ __all__ = [
"AlbertForSequenceClassification",
"AlbertForTokenClassification",
"AlbertForQuestionAnswering",
"AlbertForMultipleChoice"
"AlbertForMultipleChoice",
]

View File

@ -1137,5 +1137,5 @@ __all__ = [
"FlaxAlbertForSequenceClassification",
"FlaxAlbertForMultipleChoice",
"FlaxAlbertForTokenClassification",
"FlaxAlbertForQuestionAnswering"
"FlaxAlbertForQuestionAnswering",
]

View File

@ -1569,6 +1569,7 @@ class TFAlbertForMultipleChoice(TFAlbertPreTrainedModel, TFMultipleChoiceLoss):
with tf.name_scope(self.classifier.name):
self.classifier.build([None, None, self.config.hidden_size])
__all__ = [
"TFAlbertPreTrainedModel",
"TFAlbertModel",
@ -1577,5 +1578,5 @@ __all__ = [
"TFAlbertForSequenceClassification",
"TFAlbertForTokenClassification",
"TFAlbertForQuestionAnswering",
"TFAlbertForMultipleChoice"
"TFAlbertForMultipleChoice",
]

View File

@ -347,6 +347,5 @@ class AlbertTokenizer(PreTrainedTokenizer):
return (out_vocab_file,)
__all__ = [
"AlbertTokenizer"
]
__all__ = ["AlbertTokenizer"]

View File

@ -211,6 +211,5 @@ class AlbertTokenizerFast(PreTrainedTokenizerFast):
return (out_vocab_file,)
__all__ = [
"AlbertTokenizerFast"
]
__all__ = ["AlbertTokenizerFast"]

View File

@ -384,8 +384,5 @@ class AlignConfig(PretrainedConfig):
return cls(text_config=text_config.to_dict(), vision_config=vision_config.to_dict(), **kwargs)
__all__ = [
"AlignTextConfig",
"AlignVisionConfig",
"AlignConfig"
]
__all__ = ["AlignTextConfig", "AlignVisionConfig", "AlignConfig"]

View File

@ -1642,9 +1642,5 @@ class AlignModel(AlignPreTrainedModel):
vision_model_output=vision_outputs,
)
__all__ = [
"AlignPreTrainedModel",
"AlignTextModel",
"AlignVisionModel",
"AlignModel"
]
__all__ = ["AlignPreTrainedModel", "AlignTextModel", "AlignVisionModel", "AlignModel"]

View File

@ -122,6 +122,5 @@ class AlignProcessor(ProcessorMixin):
image_processor_input_names = self.image_processor.model_input_names
return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names))
__all__ = [
"AlignProcessor"
]
__all__ = ["AlignProcessor"]

View File

@ -402,8 +402,5 @@ class AltCLIPConfig(PretrainedConfig):
return cls(text_config=text_config.to_dict(), vision_config=vision_config.to_dict(), **kwargs)
__all__ = [
"AltCLIPTextConfig",
"AltCLIPVisionConfig",
"AltCLIPConfig"
]
__all__ = ["AltCLIPTextConfig", "AltCLIPVisionConfig", "AltCLIPConfig"]

View File

@ -1702,9 +1702,5 @@ def create_position_ids_from_input_ids(input_ids, padding_idx, past_key_values_l
incremental_indices = (torch.cumsum(mask, dim=1).type_as(mask) + past_key_values_length) * mask
return incremental_indices.long() + padding_idx
__all__ = [
"AltCLIPPreTrainedModel",
"AltCLIPVisionModel",
"AltCLIPTextModel",
"AltCLIPModel"
]
__all__ = ["AltCLIPPreTrainedModel", "AltCLIPVisionModel", "AltCLIPTextModel", "AltCLIPModel"]

View File

@ -132,6 +132,5 @@ class AltCLIPProcessor(ProcessorMixin):
image_processor_input_names = self.image_processor.model_input_names
return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names))
__all__ = [
"AltCLIPProcessor"
]
__all__ = ["AltCLIPProcessor"]

View File

@ -122,6 +122,5 @@ class ASTConfig(PretrainedConfig):
self.max_length = max_length
self.num_mel_bins = num_mel_bins
__all__ = [
"ASTConfig"
]
__all__ = ["ASTConfig"]

View File

@ -237,6 +237,5 @@ class ASTFeatureExtractor(SequenceFeatureExtractor):
return padded_inputs
__all__ = [
"ASTFeatureExtractor"
]
__all__ = ["ASTFeatureExtractor"]

View File

@ -613,8 +613,5 @@ class ASTForAudioClassification(ASTPreTrainedModel):
attentions=outputs.attentions,
)
__all__ = [
"ASTPreTrainedModel",
"ASTModel",
"ASTForAudioClassification"
]
__all__ = ["ASTPreTrainedModel", "ASTModel", "ASTForAudioClassification"]

View File

@ -243,6 +243,5 @@ class AutoformerConfig(PretrainedConfig):
+ self.input_size * 2 # the log1p(abs(loc)) and log(scale) features
)
__all__ = [
"AutoformerConfig"
]
__all__ = ["AutoformerConfig"]

View File

@ -2155,8 +2155,5 @@ class AutoformerForPrediction(AutoformerPreTrainedModel):
)
)
__all__ = [
"AutoformerPreTrainedModel",
"AutoformerModel",
"AutoformerForPrediction"
]
__all__ = ["AutoformerPreTrainedModel", "AutoformerModel", "AutoformerForPrediction"]

View File

@ -329,9 +329,5 @@ class BarkConfig(PretrainedConfig):
**kwargs,
)
__all__ = [
"BarkSemanticConfig",
"BarkCoarseConfig",
"BarkFineConfig",
"BarkConfig"
]
__all__ = ["BarkSemanticConfig", "BarkCoarseConfig", "BarkFineConfig", "BarkConfig"]

View File

@ -1023,7 +1023,7 @@ class BarkSemanticModel(BarkCausalModel):
language modeling head on top.""",
BARK_MODEL_START_DOCSTRING.format(config="BarkCoarseConfig"),
)
@register(backends=('torch',))
@register(backends=("torch",))
class BarkCoarseModel(BarkCausalModel):
base_model_prefix = "coarse_acoustics"
config_class = BarkCoarseConfig
@ -1911,11 +1911,12 @@ class BarkModel(BarkPreTrainedModel):
config.fine_acoustics_config._attn_implementation = config._attn_implementation
return config
__all__ = [
"BarkPreTrainedModel",
"BarkCausalModel",
"BarkFineModel",
"BarkCoarseModel",
"BarkSemanticModel",
"BarkModel"
"BarkModel",
]

View File

@ -287,6 +287,5 @@ class BarkProcessor(ProcessorMixin):
return encoded_text
__all__ = [
"BarkProcessor"
]
__all__ = ["BarkProcessor"]

View File

@ -403,7 +403,5 @@ class BartOnnxConfig(OnnxSeq2SeqConfigWithPast):
flattened_output, name, idx, t
)
__all__ = [
"BartConfig",
"BartOnnxConfig"
]
__all__ = ["BartConfig", "BartOnnxConfig"]

View File

@ -2334,6 +2334,7 @@ class BartForCausalLM(BartPreTrainedModel):
)
return reordered_past
__all__ = [
"BartPreTrainedModel",
"PretrainedBartModel",
@ -2343,5 +2344,5 @@ __all__ = [
"BartForConditionalGeneration",
"BartForSequenceClassification",
"BartForQuestionAnswering",
"BartForCausalLM"
"BartForCausalLM",
]

View File

@ -2009,5 +2009,5 @@ __all__ = [
"FlaxBartForSequenceClassification",
"FlaxBartForQuestionAnswering",
"FlaxBartDecoderPreTrainedModel",
"FlaxBartForCausalLM"
"FlaxBartForCausalLM",
]

View File

@ -1716,9 +1716,5 @@ class TFBartForSequenceClassification(TFBartPretrainedModel, TFSequenceClassific
with tf.name_scope(self.classification_head.name):
self.classification_head.build(None)
__all__ = [
"TFBartPretrainedModel",
"TFBartModel",
"TFBartForConditionalGeneration",
"TFBartForSequenceClassification"
]
__all__ = ["TFBartPretrainedModel", "TFBartModel", "TFBartForConditionalGeneration", "TFBartForSequenceClassification"]

View File

@ -391,6 +391,5 @@ class BartTokenizer(PreTrainedTokenizer):
text = " " + text
return (text, kwargs)
__all__ = [
"BartTokenizer"
]
__all__ = ["BartTokenizer"]

View File

@ -277,6 +277,5 @@ class BartTokenizerFast(PreTrainedTokenizerFast):
return len(cls + token_ids_0 + sep) * [0]
return len(cls + token_ids_0 + sep + sep + token_ids_1 + sep) * [0]
__all__ = [
"BartTokenizerFast"
]
__all__ = ["BartTokenizerFast"]

View File

@ -288,6 +288,5 @@ class BarthezTokenizer(PreTrainedTokenizer):
return (out_vocab_file,)
__all__ = [
"BarthezTokenizer"
]
__all__ = ["BarthezTokenizer"]

View File

@ -196,6 +196,5 @@ class BarthezTokenizerFast(PreTrainedTokenizerFast):
return (out_vocab_file,)
__all__ = [
"BarthezTokenizerFast"
]
__all__ = ["BarthezTokenizerFast"]

View File

@ -315,6 +315,5 @@ class BartphoTokenizer(PreTrainedTokenizer):
return out_vocab_file, out_monolingual_vocab_file
__all__ = [
"BartphoTokenizer"
]
__all__ = ["BartphoTokenizer"]

View File

@ -230,7 +230,5 @@ class BeitOnnxConfig(OnnxConfig):
def atol_for_validation(self) -> float:
return 1e-4
__all__ = [
"BeitConfig",
"BeitOnnxConfig"
]
__all__ = ["BeitConfig", "BeitOnnxConfig"]

View File

@ -34,6 +34,5 @@ class BeitFeatureExtractor(BeitImageProcessor):
)
super().__init__(*args, **kwargs)
__all__ = [
"BeitFeatureExtractor"
]
__all__ = ["BeitFeatureExtractor"]

View File

@ -532,6 +532,5 @@ class BeitImageProcessor(BaseImageProcessor):
return semantic_segmentation
__all__ = [
"BeitImageProcessor"
]
__all__ = ["BeitImageProcessor"]

View File

@ -1429,11 +1429,12 @@ class BeitBackbone(BeitPreTrainedModel, BackboneMixin):
attentions=outputs.attentions,
)
__all__ = [
"BeitPreTrainedModel",
"BeitModel",
"BeitForMaskedImageModeling",
"BeitForImageClassification",
"BeitForSemanticSegmentation",
"BeitBackbone"
"BeitBackbone",
]

View File

@ -956,5 +956,5 @@ __all__ = [
"FlaxBeitPreTrainedModel",
"FlaxBeitModel",
"FlaxBeitForMaskedImageModeling",
"FlaxBeitForImageClassification"
"FlaxBeitForImageClassification",
]

View File

@ -152,7 +152,5 @@ class BertOnnxConfig(OnnxConfig):
]
)
__all__ = [
"BertConfig",
"BertOnnxConfig"
]
__all__ = ["BertConfig", "BertOnnxConfig"]

View File

@ -2030,6 +2030,7 @@ class BertForQuestionAnswering(BertPreTrainedModel):
attentions=outputs.attentions,
)
__all__ = [
"load_tf_weights_in_bert",
"BertPreTrainedModel",
@ -2041,5 +2042,5 @@ __all__ = [
"BertForSequenceClassification",
"BertForMultipleChoice",
"BertForTokenClassification",
"BertForQuestionAnswering"
"BertForQuestionAnswering",
]

View File

@ -1733,5 +1733,5 @@ __all__ = [
"FlaxBertForMultipleChoice",
"FlaxBertForTokenClassification",
"FlaxBertForQuestionAnswering",
"FlaxBertForCausalLM"
"FlaxBertForCausalLM",
]

View File

@ -2121,6 +2121,7 @@ class TFBertForQuestionAnswering(TFBertPreTrainedModel, TFQuestionAnsweringLoss)
with tf.name_scope(self.qa_outputs.name):
self.qa_outputs.build([None, None, self.config.hidden_size])
__all__ = [
"TFBertPreTrainedModel",
"TFBertModel",
@ -2131,5 +2132,5 @@ __all__ = [
"TFBertForSequenceClassification",
"TFBertForMultipleChoice",
"TFBertForTokenClassification",
"TFBertForQuestionAnswering"
"TFBertForQuestionAnswering",
]

View File

@ -503,8 +503,5 @@ class WordpieceTokenizer(object):
output_tokens.extend(sub_tokens)
return output_tokens
__all__ = [
"BertTokenizer",
"BasicTokenizer",
"WordpieceTokenizer"
]
__all__ = ["BertTokenizer", "BasicTokenizer", "WordpieceTokenizer"]

View File

@ -173,6 +173,5 @@ class BertTokenizerFast(PreTrainedTokenizerFast):
files = self._tokenizer.model.save(save_directory, name=filename_prefix)
return tuple(files)
__all__ = [
"BertTokenizerFast"
]
__all__ = ["BertTokenizerFast"]

View File

@ -125,6 +125,5 @@ class BertGenerationConfig(PretrainedConfig):
self.position_embedding_type = position_embedding_type
self.use_cache = use_cache
__all__ = [
"BertGenerationConfig"
]
__all__ = ["BertGenerationConfig"]

View File

@ -1024,9 +1024,10 @@ class BertGenerationDecoder(BertGenerationPreTrainedModel):
)
return reordered_past
__all__ = [
"load_tf_weights_in_bert_generation",
"BertGenerationPreTrainedModel",
"BertGenerationEncoder",
"BertGenerationDecoder"
"BertGenerationDecoder",
]

View File

@ -174,6 +174,5 @@ class BertGenerationTokenizer(PreTrainedTokenizer):
return (out_vocab_file,)
__all__ = [
"BertGenerationTokenizer"
]
__all__ = ["BertGenerationTokenizer"]

View File

@ -983,8 +983,5 @@ class SentencepieceTokenizer(object):
return new_pieces
__all__ = [
"BertJapaneseTokenizer",
"CharacterTokenizer",
"MecabTokenizer"
]
__all__ = ["BertJapaneseTokenizer", "CharacterTokenizer", "MecabTokenizer"]

View File

@ -768,6 +768,4 @@ def casual_tokenize(text, preserve_case=True, reduce_len=False, strip_handles=Fa
###############################################################################
__all__ = [
"BertweetTokenizer"
]
__all__ = ["BertweetTokenizer"]

View File

@ -174,7 +174,5 @@ class BigBirdOnnxConfig(OnnxConfig):
]
)
__all__ = [
"BigBirdConfig",
"BigBirdOnnxConfig"
]
__all__ = ["BigBirdConfig", "BigBirdOnnxConfig"]

View File

@ -3162,6 +3162,7 @@ class BigBirdForQuestionAnswering(BigBirdPreTrainedModel):
mask = torch.where(mask < q_lengths, 1, 0)
return mask
__all__ = [
"load_tf_weights_in_big_bird",
"BigBirdPreTrainedModel",
@ -3172,5 +3173,5 @@ __all__ = [
"BigBirdForSequenceClassification",
"BigBirdForMultipleChoice",
"BigBirdForTokenClassification",
"BigBirdForQuestionAnswering"
"BigBirdForQuestionAnswering",
]

View File

@ -2653,5 +2653,5 @@ __all__ = [
"FlaxBigBirdForMultipleChoice",
"FlaxBigBirdForTokenClassification",
"FlaxBigBirdForQuestionAnswering",
"FlaxBigBirdForCausalLM"
"FlaxBigBirdForCausalLM",
]

View File

@ -323,6 +323,5 @@ class BigBirdTokenizer(PreTrainedTokenizer):
return len(cls + token_ids_0 + sep) * [0]
return len(cls + token_ids_0 + sep) * [0] + len(token_ids_1 + sep) * [1]
__all__ = [
"BigBirdTokenizer"
]
__all__ = ["BigBirdTokenizer"]

View File

@ -231,6 +231,5 @@ class BigBirdTokenizerFast(PreTrainedTokenizerFast):
return (out_vocab_file,)
__all__ = [
"BigBirdTokenizerFast"
]
__all__ = ["BigBirdTokenizerFast"]

View File

@ -411,7 +411,5 @@ class BigBirdPegasusOnnxConfig(OnnxSeq2SeqConfigWithPast):
flattened_output, name, idx, t
)
__all__ = [
"BigBirdPegasusConfig",
"BigBirdPegasusOnnxConfig"
]
__all__ = ["BigBirdPegasusConfig", "BigBirdPegasusOnnxConfig"]

View File

@ -3093,11 +3093,12 @@ class BigBirdPegasusForCausalLM(BigBirdPegasusPreTrainedModel):
)
return reordered_past
__all__ = [
"BigBirdPegasusPreTrainedModel",
"BigBirdPegasusModel",
"BigBirdPegasusForConditionalGeneration",
"BigBirdPegasusForSequenceClassification",
"BigBirdPegasusForQuestionAnswering",
"BigBirdPegasusForCausalLM"
"BigBirdPegasusForCausalLM",
]

View File

@ -132,6 +132,5 @@ class BioGptConfig(PretrainedConfig):
self.activation_dropout = activation_dropout
super().__init__(pad_token_id=pad_token_id, bos_token_id=bos_token_id, eos_token_id=eos_token_id, **kwargs)
__all__ = [
"BioGptConfig"
]
__all__ = ["BioGptConfig"]

View File

@ -942,10 +942,11 @@ class BioGptForSequenceClassification(BioGptPreTrainedModel):
def set_input_embeddings(self, value):
self.biogpt.embed_tokens = value
__all__ = [
"BioGptPreTrainedModel",
"BioGptModel",
"BioGptForCausalLM",
"BioGptForTokenClassification",
"BioGptForSequenceClassification"
"BioGptForSequenceClassification",
]

View File

@ -358,6 +358,5 @@ class BioGptTokenizer(PreTrainedTokenizer):
self.sm = sacremoses
__all__ = [
"BioGptTokenizer"
]
__all__ = ["BioGptTokenizer"]

View File

@ -134,6 +134,5 @@ class BitConfig(BackboneConfigMixin, PretrainedConfig):
out_features=out_features, out_indices=out_indices, stage_names=self.stage_names
)
__all__ = [
"BitConfig"
]
__all__ = ["BitConfig"]

View File

@ -346,6 +346,5 @@ class BitImageProcessor(BaseImageProcessor):
data = {"pixel_values": images}
return BatchFeature(data=data, tensor_type=return_tensors)
__all__ = [
"BitImageProcessor"
]
__all__ = ["BitImageProcessor"]

View File

@ -900,9 +900,5 @@ class BitBackbone(BitPreTrainedModel, BackboneMixin):
attentions=None,
)
__all__ = [
"BitPreTrainedModel",
"BitModel",
"BitForImageClassification",
"BitBackbone"
]
__all__ = ["BitPreTrainedModel", "BitModel", "BitForImageClassification", "BitBackbone"]

View File

@ -394,7 +394,5 @@ class BlenderbotOnnxConfig(OnnxSeq2SeqConfigWithPast):
inputs_or_outputs[f"{name}.{i}.encoder.key"] = {0: "batch", 2: encoder_sequence}
inputs_or_outputs[f"{name}.{i}.encoder.value"] = {0: "batch", 2: encoder_sequence}
__all__ = [
"BlenderbotConfig",
"BlenderbotOnnxConfig"
]
__all__ = ["BlenderbotConfig", "BlenderbotOnnxConfig"]

View File

@ -1616,9 +1616,10 @@ class BlenderbotForCausalLM(BlenderbotPreTrainedModel):
)
return reordered_past
__all__ = [
"BlenderbotPreTrainedModel",
"BlenderbotModel",
"BlenderbotForConditionalGeneration",
"BlenderbotForCausalLM"
"BlenderbotForCausalLM",
]

View File

@ -1508,8 +1508,4 @@ append_replace_return_docstrings(
FlaxBlenderbotForConditionalGeneration, output_type=FlaxSeq2SeqLMOutput, config_class=_CONFIG_FOR_DOC
)
__all__ = [
"FlaxBlenderbotPreTrainedModel",
"FlaxBlenderbotModel",
"FlaxBlenderbotForConditionalGeneration"
]
__all__ = ["FlaxBlenderbotPreTrainedModel", "FlaxBlenderbotModel", "FlaxBlenderbotForConditionalGeneration"]

View File

@ -1559,8 +1559,5 @@ class TFBlenderbotForConditionalGeneration(TFBlenderbotPreTrainedModel, TFCausal
with tf.name_scope(self.bias_layer.name):
self.bias_layer.build(None)
__all__ = [
"TFBlenderbotPreTrainedModel",
"TFBlenderbotModel",
"TFBlenderbotForConditionalGeneration"
]
__all__ = ["TFBlenderbotPreTrainedModel", "TFBlenderbotModel", "TFBlenderbotForConditionalGeneration"]

View File

@ -422,6 +422,5 @@ class BlenderbotTokenizer(PreTrainedTokenizer):
"{{ eos_token }}"
)
__all__ = [
"BlenderbotTokenizer"
]
__all__ = ["BlenderbotTokenizer"]

View File

@ -304,6 +304,5 @@ class BlenderbotTokenizerFast(PreTrainedTokenizerFast):
"{{ eos_token }}"
)
__all__ = [
"BlenderbotTokenizerFast"
]
__all__ = ["BlenderbotTokenizerFast"]

View File

@ -389,7 +389,5 @@ class BlenderbotSmallOnnxConfig(OnnxSeq2SeqConfigWithPast):
flattened_output, name, idx, t
)
__all__ = [
"BlenderbotSmallConfig",
"BlenderbotSmallOnnxConfig"
]
__all__ = ["BlenderbotSmallConfig", "BlenderbotSmallOnnxConfig"]

View File

@ -1568,9 +1568,10 @@ class BlenderbotSmallForCausalLM(BlenderbotSmallPreTrainedModel):
)
return reordered_past
__all__ = [
"BlenderbotSmallPreTrainedModel",
"BlenderbotSmallModel",
"BlenderbotSmallForConditionalGeneration",
"BlenderbotSmallForCausalLM"
"BlenderbotSmallForCausalLM",
]

View File

@ -1528,5 +1528,5 @@ append_replace_return_docstrings(
__all__ = [
"FlaxBlenderbotSmallPreTrainedModel",
"FlaxBlenderbotSmallModel",
"FlaxBlenderbotSmallForConditionalGeneration"
"FlaxBlenderbotSmallForConditionalGeneration",
]

View File

@ -1529,8 +1529,5 @@ class TFBlenderbotSmallForConditionalGeneration(TFBlenderbotSmallPreTrainedModel
with tf.name_scope(self.bias_layer.name):
self.bias_layer.build(None)
__all__ = [
"TFBlenderbotSmallPreTrainedModel",
"TFBlenderbotSmallModel",
"TFBlenderbotSmallForConditionalGeneration"
]
__all__ = ["TFBlenderbotSmallPreTrainedModel", "TFBlenderbotSmallModel", "TFBlenderbotSmallForConditionalGeneration"]

View File

@ -235,6 +235,5 @@ class BlenderbotSmallTokenizer(PreTrainedTokenizer):
"{{ eos_token }}"
)
__all__ = [
"BlenderbotSmallTokenizer"
]
__all__ = ["BlenderbotSmallTokenizer"]

View File

@ -115,6 +115,5 @@ class BlenderbotSmallTokenizerFast(PreTrainedTokenizerFast):
"{{ eos_token }}"
)
__all__ = [
"BlenderbotSmallTokenizerFast"
]
__all__ = ["BlenderbotSmallTokenizerFast"]

View File

@ -365,8 +365,5 @@ class BlipConfig(PretrainedConfig):
return cls(text_config=text_config.to_dict(), vision_config=vision_config.to_dict(), **kwargs)
__all__ = [
"BlipTextConfig",
"BlipVisionConfig",
"BlipConfig"
]
__all__ = ["BlipTextConfig", "BlipVisionConfig", "BlipConfig"]

View File

@ -313,6 +313,5 @@ class BlipImageProcessor(BaseImageProcessor):
return encoded_outputs
__all__ = [
"BlipImageProcessor"
]
__all__ = ["BlipImageProcessor"]

View File

@ -1489,11 +1489,12 @@ class BlipForImageTextRetrieval(BlipPreTrainedModel):
question_embeds=question_embeds,
)
__all__ = [
"BlipPreTrainedModel",
"BlipVisionModel",
"BlipModel",
"BlipForConditionalGeneration",
"BlipForQuestionAnswering",
"BlipForImageTextRetrieval"
"BlipForImageTextRetrieval",
]

View File

@ -951,6 +951,5 @@ class BlipTextLMHeadModel(BlipTextPreTrainedModel):
)
return reordered_past
__all__ = [
"BlipTextModel"
]
__all__ = ["BlipTextModel"]

View File

@ -1704,11 +1704,12 @@ class TFBlipForImageTextRetrieval(TFBlipPreTrainedModel):
with tf.name_scope(self.itm_head.name):
self.itm_head.build([None, None, self.config.text_config.hidden_size])
__all__ = [
"TFBlipPreTrainedModel",
"TFBlipVisionModel",
"TFBlipModel",
"TFBlipForConditionalGeneration",
"TFBlipForQuestionAnswering",
"TFBlipForImageTextRetrieval"
"TFBlipForImageTextRetrieval",
]

View File

@ -1123,6 +1123,5 @@ class TFBlipTextLMHeadModel(TFBlipTextPreTrainedModel):
with tf.name_scope(self.cls.name):
self.cls.build(None)
__all__ = [
"TFBlipTextModel"
]
__all__ = ["TFBlipTextModel"]

View File

@ -151,6 +151,5 @@ class BlipProcessor(ProcessorMixin):
image_processor_input_names = self.image_processor.model_input_names
return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names))
__all__ = [
"BlipProcessor"
]
__all__ = ["BlipProcessor"]

View File

@ -355,8 +355,5 @@ class Blip2Config(PretrainedConfig):
**kwargs,
)
__all__ = [
"Blip2VisionConfig",
"Blip2QFormerConfig",
"Blip2Config"
]
__all__ = ["Blip2VisionConfig", "Blip2QFormerConfig", "Blip2Config"]

View File

@ -1863,10 +1863,11 @@ class Blip2ForConditionalGeneration(Blip2PreTrainedModel):
outputs = torch.cat([bos_tokens, outputs], dim=-1)
return outputs
__all__ = [
"Blip2PreTrainedModel",
"Blip2VisionModel",
"Blip2QFormerModel",
"Blip2Model",
"Blip2ForConditionalGeneration"
"Blip2ForConditionalGeneration",
]

View File

@ -156,6 +156,5 @@ class Blip2Processor(ProcessorMixin):
image_processor_input_names = self.image_processor.model_input_names
return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names))
__all__ = [
"Blip2Processor"
]
__all__ = ["Blip2Processor"]

View File

@ -236,7 +236,5 @@ class BloomOnnxConfig(OnnxConfigWithPast):
def default_onnx_opset(self) -> int:
return 13
__all__ = [
"BloomConfig",
"BloomOnnxConfig"
]
__all__ = ["BloomConfig", "BloomOnnxConfig"]

View File

@ -1246,11 +1246,12 @@ class BloomForQuestionAnswering(BloomPreTrainedModel):
attentions=outputs.attentions,
)
__all__ = [
"BloomPreTrainedModel",
"BloomModel",
"BloomForCausalLM",
"BloomForSequenceClassification",
"BloomForTokenClassification",
"BloomForQuestionAnswering"
"BloomForQuestionAnswering",
]

View File

@ -737,8 +737,4 @@ class FlaxBloomForCausalLM(FlaxBloomPreTrainedModel):
append_call_sample_docstring(FlaxBloomForCausalLM, _CHECKPOINT_FOR_DOC, FlaxCausalLMOutput, _CONFIG_FOR_DOC)
__all__ = [
"FlaxBloomPreTrainedModel",
"FlaxBloomModel",
"FlaxBloomForCausalLM"
]
__all__ = ["FlaxBloomPreTrainedModel", "FlaxBloomModel", "FlaxBloomForCausalLM"]

View File

@ -159,6 +159,5 @@ class BloomTokenizerFast(PreTrainedTokenizerFast):
"""
return "{% for message in messages %}" "{{ message.content }}{{ eos_token }}" "{% endfor %}"
__all__ = [
"BloomTokenizerFast"
]
__all__ = ["BloomTokenizerFast"]

View File

@ -349,8 +349,5 @@ class BridgeTowerConfig(PretrainedConfig):
return cls(text_config=text_config.to_dict(), vision_config=vision_config.to_dict(), **kwargs)
__all__ = [
"BridgeTowerVisionConfig",
"BridgeTowerTextConfig",
"BridgeTowerConfig"
]
__all__ = ["BridgeTowerVisionConfig", "BridgeTowerTextConfig", "BridgeTowerConfig"]

View File

@ -562,6 +562,5 @@ class BridgeTowerImageProcessor(BaseImageProcessor):
return encoded_outputs
__all__ = [
"BridgeTowerImageProcessor"
]
__all__ = ["BridgeTowerImageProcessor"]

View File

@ -1912,10 +1912,11 @@ class BridgeTowerForContrastiveLearning(BridgeTowerPreTrainedModel):
attentions=outputs.attentions,
)
__all__ = [
"BridgeTowerPreTrainedModel",
"BridgeTowerModel",
"BridgeTowerForMaskedLM",
"BridgeTowerForImageAndTextRetrieval",
"BridgeTowerForContrastiveLearning"
"BridgeTowerForContrastiveLearning",
]

View File

@ -120,6 +120,5 @@ class BridgeTowerProcessor(ProcessorMixin):
image_processor_input_names = self.image_processor.model_input_names
return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names))
__all__ = [
"BridgeTowerProcessor"
]
__all__ = ["BridgeTowerProcessor"]

View File

@ -136,6 +136,5 @@ class BrosConfig(PretrainedConfig):
self.dim_bbox_projection = self.hidden_size // self.num_attention_heads
self.classifier_dropout_prob = classifier_dropout_prob
__all__ = [
"BrosConfig"
]
__all__ = ["BrosConfig"]

View File

@ -1320,10 +1320,11 @@ class BrosSpadeELForTokenClassification(BrosPreTrainedModel):
attentions=outputs.attentions,
)
__all__ = [
"BrosPreTrainedModel",
"BrosModel",
"BrosForTokenClassification",
"BrosSpadeEEForTokenClassification",
"BrosSpadeELForTokenClassification"
"BrosSpadeELForTokenClassification",
]

View File

@ -110,6 +110,5 @@ class BrosProcessor(ProcessorMixin):
tokenizer_input_names = self.tokenizer.model_input_names
return list(dict.fromkeys(tokenizer_input_names))
__all__ = [
"BrosProcessor"
]
__all__ = ["BrosProcessor"]

View File

@ -235,6 +235,5 @@ class ByT5Tokenizer(PreTrainedTokenizer):
def save_vocabulary(self, save_directory: str, filename_prefix: Optional[str] = None) -> Tuple[str]:
return ()
__all__ = [
"ByT5Tokenizer"
]
__all__ = ["ByT5Tokenizer"]

View File

@ -154,7 +154,5 @@ class CamembertOnnxConfig(OnnxConfig):
]
)
__all__ = [
"CamembertConfig",
"CamembertOnnxConfig"
]
__all__ = ["CamembertConfig", "CamembertOnnxConfig"]

View File

@ -1583,6 +1583,7 @@ def create_position_ids_from_input_ids(input_ids, padding_idx, past_key_values_l
incremental_indices = (torch.cumsum(mask, dim=1).type_as(mask) + past_key_values_length) * mask
return incremental_indices.long() + padding_idx
__all__ = [
"CamembertPreTrainedModel",
"CamembertModel",
@ -1591,5 +1592,5 @@ __all__ = [
"CamembertForMultipleChoice",
"CamembertForTokenClassification",
"CamembertForQuestionAnswering",
"CamembertForCausalLM"
"CamembertForCausalLM",
]

View File

@ -1798,6 +1798,7 @@ class TFCamembertForCausalLM(TFCamembertPreTrainedModel, TFCausalLanguageModelin
with tf.name_scope(self.lm_head.name):
self.lm_head.build(None)
__all__ = [
"TFCamembertPreTrainedModel",
"TFCamembertModel",
@ -1806,5 +1807,5 @@ __all__ = [
"TFCamembertForTokenClassification",
"TFCamembertForMultipleChoice",
"TFCamembertForQuestionAnswering",
"TFCamembertForCausalLM"
"TFCamembertForCausalLM",
]

View File

@ -320,6 +320,5 @@ class CamembertTokenizer(PreTrainedTokenizer):
return len(cls + token_ids_0 + sep) * [0]
return len(cls + token_ids_0 + sep + sep + token_ids_1 + sep) * [0]
__all__ = [
"CamembertTokenizer"
]
__all__ = ["CamembertTokenizer"]

Some files were not shown because too many files have changed in this diff Show More