mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2026-07-09 13:27:10 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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])
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
# limitations under the License.
|
||||
"""Dataloaders."""
|
||||
|
||||
|
||||
import torch
|
||||
|
||||
from colossalai.legacy.context import ParallelMode
|
||||
|
||||
Reference in New Issue
Block a user