mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-04 18:11:02 +00:00
clean up and jank windows wheel build
This commit is contained in:
@@ -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)
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -36,19 +36,19 @@ def copy_prebuilt_C_lib(src_dir, dest_dir, dest_build_dir):
|
||||
os.mkdir(dest_dir)
|
||||
os.mkdir(dest_build_dir)
|
||||
|
||||
for dirpath, _, filenames in os.walk(src_dir):
|
||||
for item in filenames:
|
||||
# copy over header files to dest dir
|
||||
for dirpath, _, filenames in os.walk(src_dir):
|
||||
for item in filenames:
|
||||
# copy over header files to dest dir
|
||||
s = os.path.join(dirpath, item)
|
||||
if item.endswith(".h"):
|
||||
d = os.path.join(dest_dir, item)
|
||||
shutil.copy2(s, d)
|
||||
files_copied += 1
|
||||
if item.endswith(lib_ext):
|
||||
s = os.path.join(dirpath, item)
|
||||
if item.endswith(".h"):
|
||||
d = os.path.join(dest_dir, item)
|
||||
shutil.copy2(s, d)
|
||||
files_copied += 1
|
||||
if item.endswith(lib_ext):
|
||||
s = os.path.join(dirpath, item)
|
||||
d = os.path.join(dest_build_dir, item)
|
||||
shutil.copy2(s, d)
|
||||
files_copied += 1
|
||||
d = os.path.join(dest_build_dir, item)
|
||||
shutil.copy2(s, d)
|
||||
files_copied += 1
|
||||
|
||||
return files_copied
|
||||
|
||||
|
Reference in New Issue
Block a user