|
|
@ -81,14 +81,14 @@ class GPT4All():
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
os.makedirs(DEFAULT_MODEL_DIRECTORY, exist_ok=True)
|
|
|
|
os.makedirs(DEFAULT_MODEL_DIRECTORY, exist_ok=True)
|
|
|
|
except OSError as exc:
|
|
|
|
except OSError as exc:
|
|
|
|
raise ValueError("Failed to create model download directory at {}: {}. "
|
|
|
|
raise ValueError(f"Failed to create model download directory at {DEFAULT_MODEL_DIRECTORY}: {exc}. "
|
|
|
|
"Please specify model_path.".format(DEFAULT_MODEL_DIRECTORY, exc))
|
|
|
|
"Please specify model_path.")
|
|
|
|
model_path = DEFAULT_MODEL_DIRECTORY
|
|
|
|
model_path = DEFAULT_MODEL_DIRECTORY
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
model_path = model_path.replace("\\", "\\\\")
|
|
|
|
model_path = model_path.replace("\\", "\\\\")
|
|
|
|
|
|
|
|
|
|
|
|
if not os.path.exists(model_path):
|
|
|
|
if not os.path.exists(model_path):
|
|
|
|
raise ValueError("Invalid model directory: {}".format(model_path))
|
|
|
|
raise ValueError(f"Invalid model directory: {model_path}")
|
|
|
|
|
|
|
|
|
|
|
|
model_dest = os.path.join(model_path, model_filename).replace("\\", "\\\\")
|
|
|
|
model_dest = os.path.join(model_path, model_filename).replace("\\", "\\\\")
|
|
|
|
if os.path.exists(model_dest):
|
|
|
|
if os.path.exists(model_dest):
|
|
|
|