Update quality tooling for formatting (#21480)
* Result of black 23.1 * Update target to Python 3.7 * Switch flake8 to ruff * Configure isort * Configure isort * Apply isort with line limit * Put the right black version * adapt black in check copies * Fix copies
This commit is contained in:
@@ -26,10 +26,11 @@ from dataclasses import dataclass, field
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
import evaluate
|
||||
import tensorflow as tf
|
||||
from datasets import load_dataset
|
||||
from utils_qa import postprocess_qa_predictions
|
||||
|
||||
import evaluate
|
||||
import transformers
|
||||
from transformers import (
|
||||
AutoConfig,
|
||||
@@ -44,7 +45,6 @@ from transformers import (
|
||||
set_seed,
|
||||
)
|
||||
from transformers.utils import CONFIG_NAME, TF2_WEIGHTS_NAME, check_min_version, send_example_telemetry
|
||||
from utils_qa import postprocess_qa_predictions
|
||||
|
||||
|
||||
# Will error if the minimal version of Transformers is not installed. Remove at your own risks.
|
||||
@@ -214,6 +214,7 @@ class DataTrainingArguments:
|
||||
|
||||
# endregion
|
||||
|
||||
|
||||
# region Helper classes
|
||||
class SavePretrainedCallback(tf.keras.callbacks.Callback):
|
||||
# Hugging Face models have a save_pretrained() method that saves both the weights and the necessary
|
||||
@@ -610,7 +611,6 @@ def main():
|
||||
# endregion
|
||||
|
||||
with training_args.strategy.scope():
|
||||
|
||||
dataset_options = tf.data.Options()
|
||||
dataset_options.experimental_distribute.auto_shard_policy = tf.data.experimental.AutoShardPolicy.OFF
|
||||
num_replicas = training_args.strategy.num_replicas_in_sync
|
||||
@@ -628,7 +628,6 @@ def main():
|
||||
use_auth_token=True if model_args.use_auth_token else None,
|
||||
)
|
||||
if training_args.do_train:
|
||||
|
||||
training_dataset = model.prepare_tf_dataset(
|
||||
processed_datasets["train"],
|
||||
shuffle=True,
|
||||
|
||||
Reference in New Issue
Block a user