Remove deprecated logic and warnings (#30743)

* Remove deprecated logic and warnings

* Add back some code that seems to be important...

* Let's just add all he nllb stuff back; removing it is a bit more involved

* Remove kwargs

* Remove more kwargs
This commit is contained in:
amyeroberts
2024-05-17 12:15:59 +01:00
committed by GitHub
parent 3d7d3a87a0
commit 57c965a8f1
68 changed files with 6 additions and 1463 deletions

View File

@@ -16,7 +16,6 @@
import logging
import os
import sys
import warnings
from dataclasses import dataclass, field
from typing import Optional
@@ -143,12 +142,6 @@ class ModelArguments:
)
},
)
use_auth_token: bool = field(
default=None,
metadata={
"help": "The `use_auth_token` argument is deprecated and will be removed in v4.34. Please use `token` instead."
},
)
mask_ratio: float = field(
default=0.75, metadata={"help": "The ratio of the number of masked tokens in the input sequence."}
)
@@ -182,15 +175,6 @@ def main():
else:
model_args, data_args, training_args = parser.parse_args_into_dataclasses()
if model_args.use_auth_token is not None:
warnings.warn(
"The `use_auth_token` argument is deprecated and will be removed in v4.34. Please use `token` instead.",
FutureWarning,
)
if model_args.token is not None:
raise ValueError("`token` and `use_auth_token` are both specified. Please set only the argument `token`.")
model_args.token = model_args.use_auth_token
# Sending telemetry. Tracking the example usage helps us better allocate resources to maintain them. The
# information sent is the one passed as arguments along with your Python/PyTorch versions.
send_example_telemetry("run_mae", model_args, data_args)

View File

@@ -16,7 +16,6 @@
import logging
import os
import sys
import warnings
from dataclasses import dataclass, field
from typing import Optional
@@ -163,12 +162,6 @@ class ModelArguments:
)
},
)
use_auth_token: bool = field(
default=None,
metadata={
"help": "The `use_auth_token` argument is deprecated and will be removed in v4.34. Please use `token` instead."
},
)
trust_remote_code: bool = field(
default=False,
metadata={
@@ -256,15 +249,6 @@ def main():
else:
model_args, data_args, training_args = parser.parse_args_into_dataclasses()
if model_args.use_auth_token is not None:
warnings.warn(
"The `use_auth_token` argument is deprecated and will be removed in v4.34. Please use `token` instead.",
FutureWarning,
)
if model_args.token is not None:
raise ValueError("`token` and `use_auth_token` are both specified. Please set only the argument `token`.")
model_args.token = model_args.use_auth_token
# Sending telemetry. Tracking the example usage helps us better allocate resources to maintain them. The
# information sent is the one passed as arguments along with your Python/PyTorch versions.
send_example_telemetry("run_mim", model_args, data_args)

View File

@@ -17,7 +17,6 @@ import argparse
import logging
import math
import os
import warnings
from pathlib import Path
import datasets
@@ -196,12 +195,6 @@ def parse_args():
"generated when running `huggingface-cli login` (stored in `~/.huggingface`)."
),
)
parser.add_argument(
"--use_auth_token",
type=bool,
default=None,
help="The `use_auth_token` argument is deprecated and will be removed in v4.34. Please use `token` instead.",
)
parser.add_argument(
"--trust_remote_code",
type=bool,
@@ -384,15 +377,6 @@ def collate_fn(examples):
def main():
args = parse_args()
if args.use_auth_token is not None:
warnings.warn(
"The `use_auth_token` argument is deprecated and will be removed in v4.34. Please use `token` instead.",
FutureWarning,
)
if args.token is not None:
raise ValueError("`token` and `use_auth_token` are both specified. Please set only the argument `token`.")
args.token = args.use_auth_token
# Sending telemetry. Tracking the example usage helps us better allocate resources to maintain them. The
# information sent is the one passed as arguments along with your Python/PyTorch versions.
send_example_telemetry("run_mim_no_trainer", args)