Skip to content

Commit c426ade

Browse files
authored
[minor] print cpu utilization warning
builds on neonbjb#249
1 parent c9951ac commit c426ade

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tortoise/api.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,12 @@ def __init__(self, autoregressive_batch_size=None, models_dir=MODELS_DIR, enable
213213
self.models_dir = models_dir
214214
self.autoregressive_batch_size = pick_best_batch_size_for_gpu() if autoregressive_batch_size is None else autoregressive_batch_size
215215
self.enable_redaction = enable_redaction
216-
self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
216+
if not self.device:
217+
self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
218+
else:
219+
self.device = device
220+
if self.device == 'cpu':
221+
print("Using cpu, expect extremely long processing time!")
217222
if self.enable_redaction:
218223
self.aligner = Wav2VecAlignment()
219224

0 commit comments

Comments
 (0)