[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot]
2026-05-25 17:39:09 +00:00
parent ec1635477e
commit 1ee5875d61
50 changed files with 188 additions and 214 deletions

View File

@@ -20,6 +20,7 @@ on a text file or a dataset without using HuggingFace Trainer.
Here is the full list of checkpoints on the hub that can be fine-tuned by this script:
https://huggingface.co/models?filter=text-generation
"""
# You can also adapt this script on your own causal language modeling task. Pointers for this are left as comments.
import math

View File

@@ -18,7 +18,7 @@ def cyclic_iter(iter):
def build_train_valid_test_data_iterators(
train_iters, global_batch_size, eval_interval, eval_iters, dataloader_type="single", **kwargs
):
(train_dataloader, valid_dataloader, test_dataloader) = (None, None, None)
train_dataloader, valid_dataloader, test_dataloader = (None, None, None)
logger = get_dist_logger()
logger.info("> building train, validation, and test datasets ...", ranks=[0])

View File

@@ -252,7 +252,7 @@ def build_training_sample(
# Masking.
max_predictions_per_seq = masked_lm_prob * max_num_tokens
(tokens, masked_positions, masked_labels, _) = create_masked_lm_predictions(
tokens, masked_positions, masked_labels, _ = create_masked_lm_predictions(
tokens,
vocab_id_list,
vocab_id_to_token_dict,

View File

@@ -14,7 +14,6 @@
# limitations under the License.
"""Dataloaders."""
import torch
from colossalai.legacy.context import ParallelMode