reference load cleanup

Signed-off-by: vladmandic <mandic00@live.com>
This commit is contained in:
vladmandic
2025-10-25 23:25:10 -04:00
parent cffca11d5b
commit 512036d291
6 changed files with 28 additions and 18 deletions
+2 -1
View File
@@ -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))