Skip to content

Commit c3d5666

Browse files
committed
with lucain's fix
1 parent 82a58ee commit c3d5666

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/huggingface_hub/utils/_http.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import atexit
1818
import io
1919
import json
20+
import os
2021
import re
2122
import threading
2223
import time
@@ -244,6 +245,8 @@ def close_session() -> None:
244245

245246

246247
atexit.register(close_session)
248+
if hasattr(os, "register_at_fork"):
249+
os.register_at_fork(after_in_child=close_session)
247250

248251

249252
def _http_backoff_base(

0 commit comments

Comments
 (0)