Spaces:
Running on Zero
Running on Zero
Silence expected inference-only checkpoint load diagnostics
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
from __future__ import annotations
|
| 2 |
|
|
|
|
| 3 |
import re
|
| 4 |
import sys
|
| 5 |
import threading
|
|
@@ -94,7 +95,13 @@ class Engine:
|
|
| 94 |
self.hps.train.segment_size // self.hps.data.hop_length,
|
| 95 |
**self.hps.model,
|
| 96 |
).eval()
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
self.device = torch.device("cpu")
|
| 99 |
self.sample_rate = int(self.hps.data.sampling_rate)
|
| 100 |
self.lock = threading.Lock()
|
|
|
|
| 1 |
from __future__ import annotations
|
| 2 |
|
| 3 |
+
import logging
|
| 4 |
import re
|
| 5 |
import sys
|
| 6 |
import threading
|
|
|
|
| 95 |
self.hps.train.segment_size // self.hps.data.hop_length,
|
| 96 |
**self.hps.model,
|
| 97 |
).eval()
|
| 98 |
+
root_logger = logging.getLogger()
|
| 99 |
+
previous_level = root_logger.level
|
| 100 |
+
try:
|
| 101 |
+
root_logger.setLevel(logging.WARNING)
|
| 102 |
+
utils.load_checkpoint(str(spec.checkpoint), self.model, None)
|
| 103 |
+
finally:
|
| 104 |
+
root_logger.setLevel(previous_level)
|
| 105 |
self.device = torch.device("cpu")
|
| 106 |
self.sample_rate = int(self.hps.data.sampling_rate)
|
| 107 |
self.lock = threading.Lock()
|