Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
willdumm committed Jan 24, 2025
1 parent 9111b8b commit d12c1cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions netam/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ def parallelize_function(
max_worker_count = min(mp.cpu_count() // 2, max_workers)
if max_worker_count <= 1:
return function
force_spawn()

@wraps(function)
def wrapper(*args, **kwargs):
Expand Down
1 change: 1 addition & 0 deletions netam/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ def crepe_exists(prefix):

def trimmed_shm_model_outputs_of_crepe(crepe, parents):
"""Model outputs trimmed to the length of the parent sequences."""
crepe.to("cpu")
rates, csp_logits = parallelize_function(crepe)(parents)
rates = rates.cpu().detach()
csps = torch.softmax(csp_logits, dim=-1).cpu().detach()
Expand Down

0 comments on commit d12c1cd

Please sign in to comment.