Skip to content

Commit

Permalink
Fix import in Accelerate for find_exec_bs (#21501)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgugger committed Feb 9, 2023
1 parent 02c3f41 commit 865bb4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transformers/trainer_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,9 +646,9 @@ def find_executable_batch_size(

if auto_find_batch_size:
requires_backends(find_executable_batch_size, "accelerate")
import accelerate.memory_utils as mem_utils
from accelerate.utils import find_executable_batch_size as accelerate_find_executable_batch_size

return mem_utils.find_executable_batch_size(function=function, starting_batch_size=starting_batch_size)
return accelerate_find_executable_batch_size(function=function, starting_batch_size=starting_batch_size)

return functools.partial(function, batch_size=starting_batch_size)

Expand Down

0 comments on commit 865bb4e

Please sign in to comment.