Skip to content

Commit

Permalink
Merge pull request #27 from Magi3r/patch-2
Browse files Browse the repository at this point in the history
Fix paths not existing for file copy
  • Loading branch information
FrancescoCaracciolo authored Dec 11, 2024
2 parents 25e1563 + b314d7d commit fffe37d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ def add_extension(self, file_path : str):
Args:
file_path: the path of the file to copy
"""
os.makedirs(os.path.join(self.extension_dir, os.path.basename(file_path)), exist_ok=True)
shutil.copyfile(file_path, os.path.join(self.extension_dir, os.path.basename(file_path)))

def get_extension_by_id(self, id: str) -> NewelleExtension | None:
Expand Down
2 changes: 2 additions & 0 deletions src/smart_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ def __init__(self, settings, path):
def check_files(self):
default_model = f"NyaMedium_{self.version}_{256}.pkl"
if not os.path.isfile(os.path.join(self.models_dir, default_model)):
os.makedirs(self.models_dir, exist_ok=True)
shutil.copy(os.path.join(BASE_PATH + "/smart-prompts", default_model), os.path.join(self.models_dir, default_model))
if not os.path.isfile(os.path.expanduser("~/.cache/wordllama/tokenizers/l2_supercat_tokenizer_config.json")):
os.makedirs(os.path.expanduser("~/.cache/wordllama/tokenizers/"), exist_ok=True)
shutil.copy(os.path.join(BASE_PATH + "/smart-prompts", "l2_supercat_tokenizer_config.json"), os.path.expanduser("~/.cache/wordllama/tokenizers/l2_supercat_tokenizer_config.json"))

@staticmethod
Expand Down

0 comments on commit fffe37d

Please sign in to comment.