Compare commits

...

3 Commits

Author SHA1 Message Date
Harshil
f218429159
Merge 3051db2629 into fb54d8b549 2023-05-22 17:38:15 -05:00
Harshil
3051db2629
Update trust_and_safety_models/toxicity/train.py 2023-04-02 00:56:46 +05:30
Harshil Mehta
c94f4a42b9
make it easier to do multiple fold training 2023-04-01 23:58:12 +05:30

View File

@ -387,15 +387,16 @@ class Trainer(object):
fold=i,
)
else:
raise ValueError("Sure you want to do multiple fold training")
for mb_generator, steps_per_epoch, val_data, test_data in self.mb_loader(full_df=df):
self._train_single_fold(
mb_generator=mb_generator,
val_data=val_data,
test_data=test_data,
steps_per_epoch=steps_per_epoch,
fold=i,
)
i += 1
if i == 3:
break
a = input("Are you sure you want to do multiple fold training? (y/N)")
if a.lower() == "y":
for mb_generator, steps_per_epoch, val_data, test_data in self.mb_loader(full_df=df):
self._train_single_fold(
mb_generator=mb_generator,
val_data=val_data,
test_data=test_data,
steps_per_epoch=steps_per_epoch,
fold=i,
)
i += 1
if i == 3:
break