Пример #1
0
def read_formatted_batch(dataset: nlp.Dataset, length, batch_size, type):
    with dataset.formatted_as(type=type):
        for i in range(0, length, batch_size):
            _ = dataset[i:i + batch_size]
Пример #2
0
def read_formatted(dataset: nlp.Dataset, length, type):
    with dataset.formatted_as(type=type):
        for i in range(length):
            _ = dataset[i]