mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
+2
-1
@@ -145,6 +145,7 @@ except Exception as e:
|
||||
sys.exit(1)
|
||||
|
||||
import huggingface_hub # pylint: disable=W0611,C0411
|
||||
logging.getLogger("huggingface_hub.file_download").setLevel(logging.ERROR)
|
||||
timer.startup.record("hfhub")
|
||||
|
||||
try:
|
||||
@@ -188,7 +189,7 @@ def get_packages():
|
||||
try:
|
||||
import math
|
||||
cores = os.cpu_count()
|
||||
affinity = len(os.sched_getaffinity(0))
|
||||
affinity = len(os.sched_getaffinity(0)) # pylint: disable=no-member
|
||||
threads = torch.get_num_threads()
|
||||
if threads < (affinity / 2):
|
||||
torch.set_num_threads(math.floor(affinity / 2))
|
||||
|
||||
Reference in New Issue
Block a user