Spaces:
Runtime error
Runtime error
Download utils/trainer_utils.py from amphion/singing_voice_conversion: direct link, hf CLI and curl.
- Browser
- Download file 536 Bytes
-
https://huggingface.co/spaces/amphion/singing_voice_conversion/resolve/main/utils/trainer_utils.py
- Command line
-
hf download hf://spaces/amphion/singing_voice_conversion/utils/trainer_utils.py
-
curl -L -o trainer_utils.py https://huggingface.co/spaces/amphion/singing_voice_conversion/resolve/main/utils/trainer_utils.py
536 Bytes
| # Copyright (c) 2023 Amphion. | |
| # | |
| # This source code is licensed under the MIT license found in the | |
| # LICENSE file in the root directory of this source tree. | |
| import torch | |
| def check_nan(logger, loss, y_pred, y_gt): | |
| if torch.any(torch.isnan(loss)): | |
| logger.info("out has nan: ", torch.any(torch.isnan(y_pred))) | |
| logger.info("y_gt has nan: ", torch.any(torch.isnan(y_gt))) | |
| logger.info("out: ", y_pred) | |
| logger.info("y_gt: ", y_gt) | |
| logger.info("loss = {:.4f}\n".format(loss.item())) | |
| exit() | |