clean up and jank windows wheel build

This commit is contained in:
Richard Guo
2023-05-10 15:58:27 -04:00
parent 5e873a060c
commit 23e748d1c2
5 changed files with 30 additions and 65 deletions

View File

@@ -73,7 +73,7 @@ class GPT4All():
Returns:
Model file destination.
"""
model_path = model_path.replace("\\", "\\\\")
model_filename = model_name
if ".bin" not in model_filename:
model_filename += ".bin"
@@ -87,6 +87,8 @@ class GPT4All():
except:
raise ValueError("Failed to create model download directory at ~/.cache/gpt4all/. \
Please specify download_dir.")
else:
model_path = model_path.replace("\\", "\\\\")
if os.path.exists(model_path):
model_dest = os.path.join(model_path, model_filename).replace("\\", "\\\\")
@@ -178,7 +180,6 @@ class GPT4All():
full_prompt = self._build_prompt(messages,
default_prompt_header=default_prompt_header,
default_prompt_footer=default_prompt_footer)
if verbose:
print(full_prompt)

View File

@@ -31,9 +31,7 @@ def load_llmodel_library():
# For windows
llama_dir = llama_dir.replace("\\", "\\\\")
print(llama_dir)
llmodel_dir = llmodel_dir.replace("\\", "\\\\")
print(llmodel_dir)
llama_lib = ctypes.CDLL(llama_dir, mode=ctypes.RTLD_GLOBAL)
llmodel_lib = ctypes.CDLL(llmodel_dir)
@@ -80,7 +78,6 @@ llmodel.llmodel_prompt.argtypes = [ctypes.c_void_p,
RecalculateCallback,
ctypes.POINTER(LLModelPromptContext)]
class LLModel:
"""
Base class and universal wrapper for GPT4All language models