mirror of
https://github.com/karpathy/nanochat.git
synced 2025-12-06 04:12:13 +00:00
Compare commits
2 Commits
2d09f8a725
...
2311d38e3f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2311d38e3f | ||
|
|
4bcc3bb698 |
|
|
@ -112,7 +112,7 @@ val_dataset = TaskMixture([
|
||||||
# DataLoader is defined here, it emits inputs, targets : 2D tensors of shape (device_batch_size, max_seq_len)
|
# DataLoader is defined here, it emits inputs, targets : 2D tensors of shape (device_batch_size, max_seq_len)
|
||||||
# A big problem is that we don't know the final num_iterations in advance. So we create
|
# A big problem is that we don't know the final num_iterations in advance. So we create
|
||||||
# these two global variables and update them from within the data generator.
|
# these two global variables and update them from within the data generator.
|
||||||
last_step = False # we will toggle this to True when we reach the end of the dataset
|
last_step = False # we will toggle this to True when we reach the end of the training dataset
|
||||||
approx_progress = 0.0 # will go from 0 to 1 over the course of the epoch
|
approx_progress = 0.0 # will go from 0 to 1 over the course of the epoch
|
||||||
def mid_data_generator(split):
|
def mid_data_generator(split):
|
||||||
global last_step, approx_progress
|
global last_step, approx_progress
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user