Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -409,7 +409,7 @@ class TrinerModelVITS:
|
|
409 |
self.init_wandb()
|
410 |
# self.training_args=load_training_args(self.path_training_args)
|
411 |
# training_args= self.training_args
|
412 |
-
|
413 |
# for disc in self.model.discriminator.discriminators:
|
414 |
# disc.apply_weight_norm()
|
415 |
# self.model.decoder.apply_weight_norm()
|
@@ -423,32 +423,32 @@ class TrinerModelVITS:
|
|
423 |
self.model.discriminator = None
|
424 |
self.models=(self.model,discriminator)
|
425 |
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
|
433 |
-
#
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
|
453 |
|
454 |
|
@@ -504,7 +504,7 @@ class TrinerModelVITS:
|
|
504 |
training_args.eval_steps=1000
|
505 |
|
506 |
set_seed(training_args.seed)
|
507 |
-
scaler = GradScaler(enabled=training_args.fp16)
|
508 |
|
509 |
|
510 |
# # Initialize optimizer, lr_scheduler
|
@@ -519,34 +519,34 @@ class TrinerModelVITS:
|
|
519 |
|
520 |
# discriminator = self.model.discriminator
|
521 |
# self.model.discriminator = None
|
522 |
-
model,discriminator=self.models
|
523 |
|
524 |
-
optimizer = torch.optim.AdamW(
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
)
|
530 |
|
531 |
-
# Hack to be able to train on multiple device
|
532 |
-
disc_optimizer = torch.optim.AdamW(
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
)
|
538 |
-
lr_scheduler = torch.optim.lr_scheduler.ExponentialLR(
|
539 |
-
|
540 |
-
)
|
541 |
-
disc_lr_scheduler = torch.optim.lr_scheduler.ExponentialLR(
|
542 |
-
|
543 |
-
)
|
544 |
-
# self.models=(self.model,discriminator)
|
545 |
-
self.optimizers=(optimizer,disc_optimizer,scaler)
|
546 |
-
self.lr_schedulers=(lr_scheduler,disc_lr_scheduler)
|
547 |
-
self.tools=load_tools()
|
548 |
-
self.stute_mode=True
|
549 |
-
print(self.lr_schedulers)
|
550 |
|
551 |
|
552 |
|
|
|
409 |
self.init_wandb()
|
410 |
# self.training_args=load_training_args(self.path_training_args)
|
411 |
# training_args= self.training_args
|
412 |
+
scaler = GradScaler(enabled=True)
|
413 |
# for disc in self.model.discriminator.discriminators:
|
414 |
# disc.apply_weight_norm()
|
415 |
# self.model.decoder.apply_weight_norm()
|
|
|
423 |
self.model.discriminator = None
|
424 |
self.models=(self.model,discriminator)
|
425 |
|
426 |
+
optimizer = torch.optim.AdamW(
|
427 |
+
self.model.parameters(),
|
428 |
+
2e-4,
|
429 |
+
betas=[0.8, 0.99],
|
430 |
+
# eps=training_args.adam_epsilon,
|
431 |
+
)
|
432 |
|
433 |
+
# Hack to be able to train on multiple device
|
434 |
+
disc_optimizer = torch.optim.AdamW(
|
435 |
+
discriminator.parameters(),
|
436 |
+
2e-4,
|
437 |
+
betas=[0.8, 0.99],
|
438 |
+
# eps=training_args.adam_epsilon,
|
439 |
+
)
|
440 |
+
lr_scheduler = torch.optim.lr_scheduler.ExponentialLR(
|
441 |
+
optimizer,gamma=0.999875, last_epoch=-1
|
442 |
+
)
|
443 |
+
disc_lr_scheduler = torch.optim.lr_scheduler.ExponentialLR(
|
444 |
+
disc_optimizer, gamma=0.999875,last_epoch=-1
|
445 |
+
)
|
446 |
+
# self.models=(self.model,discriminator)
|
447 |
+
self.optimizers=(optimizer,disc_optimizer,scaler)
|
448 |
+
self.lr_schedulers=(lr_scheduler,disc_lr_scheduler)
|
449 |
+
self.tools=load_tools()
|
450 |
+
self.stute_mode=True
|
451 |
+
print(self.lr_schedulers)
|
452 |
|
453 |
|
454 |
|
|
|
504 |
training_args.eval_steps=1000
|
505 |
|
506 |
set_seed(training_args.seed)
|
507 |
+
# scaler = GradScaler(enabled=training_args.fp16)
|
508 |
|
509 |
|
510 |
# # Initialize optimizer, lr_scheduler
|
|
|
519 |
|
520 |
# discriminator = self.model.discriminator
|
521 |
# self.model.discriminator = None
|
522 |
+
# model,discriminator=self.models
|
523 |
|
524 |
+
# optimizer = torch.optim.AdamW(
|
525 |
+
# model.parameters(),
|
526 |
+
# training_args.learning_rate,
|
527 |
+
# betas=[training_args.adam_beta1, training_args.adam_beta2],
|
528 |
+
# eps=training_args.adam_epsilon,
|
529 |
+
# )
|
530 |
|
531 |
+
# # Hack to be able to train on multiple device
|
532 |
+
# disc_optimizer = torch.optim.AdamW(
|
533 |
+
# discriminator.parameters(),
|
534 |
+
# training_args.d_learning_rate,
|
535 |
+
# betas=[training_args.d_adam_beta1, training_args.d_adam_beta2],
|
536 |
+
# eps=training_args.adam_epsilon,
|
537 |
+
# )
|
538 |
+
# lr_scheduler = torch.optim.lr_scheduler.ExponentialLR(
|
539 |
+
# optimizer, gamma=training_args.lr_decay, last_epoch=-1
|
540 |
+
# )
|
541 |
+
# disc_lr_scheduler = torch.optim.lr_scheduler.ExponentialLR(
|
542 |
+
# disc_optimizer, gamma=training_args.lr_decay, last_epoch=-1
|
543 |
+
# )
|
544 |
+
# # self.models=(self.model,discriminator)
|
545 |
+
# self.optimizers=(optimizer,disc_optimizer,scaler)
|
546 |
+
# self.lr_schedulers=(lr_scheduler,disc_lr_scheduler)
|
547 |
+
# self.tools=load_tools()
|
548 |
+
# self.stute_mode=True
|
549 |
+
# print(self.lr_schedulers)
|
550 |
|
551 |
|
552 |
|