mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Colab Fix
This commit is contained in:
6
utils.py
6
utils.py
@@ -190,6 +190,7 @@ class Send_to_socketio(object):
|
|||||||
def _download_with_aria2(aria2_config: str, total_length: int, directory: str = ".", user_agent=None, force_download=False, use_auth_token=None):
|
def _download_with_aria2(aria2_config: str, total_length: int, directory: str = ".", user_agent=None, force_download=False, use_auth_token=None):
|
||||||
import transformers
|
import transformers
|
||||||
lengths = {}
|
lengths = {}
|
||||||
|
path = None
|
||||||
s = requests.Session()
|
s = requests.Session()
|
||||||
s.mount("http://", requests.adapters.HTTPAdapter(max_retries=requests.adapters.Retry(total=120, backoff_factor=1)))
|
s.mount("http://", requests.adapters.HTTPAdapter(max_retries=requests.adapters.Retry(total=120, backoff_factor=1)))
|
||||||
bar = None
|
bar = None
|
||||||
@@ -232,8 +233,9 @@ def _download_with_aria2(aria2_config: str, total_length: int, directory: str =
|
|||||||
raise e
|
raise e
|
||||||
finally:
|
finally:
|
||||||
try:
|
try:
|
||||||
if os.path.exists(path):
|
if path is not None:
|
||||||
os.remove(path)
|
if os.path.exists(path):
|
||||||
|
os.remove(path)
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
code = p.wait()
|
code = p.wait()
|
||||||
|
Reference in New Issue
Block a user