Skip to content

Commit

Permalink
[minor] print cpu utilization warning
Browse files Browse the repository at this point in the history
builds on neonbjb#249
  • Loading branch information
p0p4k authored Mar 21, 2023
1 parent c9951ac commit c426ade
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tortoise/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,12 @@ def __init__(self, autoregressive_batch_size=None, models_dir=MODELS_DIR, enable
self.models_dir = models_dir
self.autoregressive_batch_size = pick_best_batch_size_for_gpu() if autoregressive_batch_size is None else autoregressive_batch_size
self.enable_redaction = enable_redaction
self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
if not self.device:
self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
else:
self.device = device
if self.device == 'cpu':
print("Using cpu, expect extremely long processing time!")
if self.enable_redaction:
self.aligner = Wav2VecAlignment()

Expand Down

0 comments on commit c426ade

Please sign in to comment.