[misc] lint (#9593)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Yaowei Zheng
2025-12-09 18:00:35 +08:00
committed by GitHub
parent 1bbb461f76
commit 5d56817e2b
23 changed files with 51 additions and 47 deletions

View File

@@ -18,8 +18,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import inspect
import os
from functools import WRAPPER_ASSIGNMENTS, partial, wraps
from types import MethodType
from typing import TYPE_CHECKING, Any, Callable, Optional, Union
@@ -156,11 +156,9 @@ def prepare_model_for_training(model: "PreTrainedModel", model_args: "ModelArgum
if (
os.environ.get("ACCELERATE_USE_FSDP", "false").lower() == "true"
and int(os.environ.get("FSDP_VERSION", "1")) == 2
):
):
model_args.use_reentrant_gc = False
logger.warning_rank0(
"You are using fsdp2, `use_reentrant_gc` has been set to False. "
)
logger.warning_rank0("You are using fsdp2, `use_reentrant_gc` has been set to False.")
if not model_args.disable_gradient_checkpointing:
if not getattr(model, "supports_gradient_checkpointing", False):

View File

@@ -28,6 +28,7 @@ from ..trainer_utils import create_modelcard_and_push
from .metric import ComputeAccuracy, ComputeSimilarity, eval_logit_processor
from .trainer import CustomSeq2SeqTrainer
if TYPE_CHECKING:
from transformers import Seq2SeqTrainingArguments, TrainerCallback
@@ -144,4 +145,4 @@ def run_sft(
trainer.save_predictions(dataset_module["eval_dataset"], predict_results, generating_args.skip_special_tokens)
# Create model card
create_modelcard_and_push(trainer, model_args, data_args, training_args, finetuning_args)
create_modelcard_and_push(trainer, model_args, data_args, training_args, finetuning_args)

View File

@@ -1 +0,0 @@