Fix local load for peft

local directory overloaded still needs the directory to locate the
weights files correctly.
This commit is contained in:
Nicolas Patry 2023-12-21 15:35:15 +00:00
parent 564199bab3
commit 83f81a6b89

View File

@ -49,7 +49,7 @@ def _weight_files_from_dir(d: Path, extension: str) -> List[str]:
# done there with the len(s.rfilename.split("/")) == 1 condition # done there with the len(s.rfilename.split("/")) == 1 condition
root, _, files = next(os.walk(str(d))) root, _, files = next(os.walk(str(d)))
filenames = [ filenames = [
f os.path.join(root, f)
for f in files for f in files
if f.endswith(extension) if f.endswith(extension)
and "arguments" not in f and "arguments" not in f