Skip to content

Commit

Permalink
Fix/errors for some models including Mistral-7b and Flan-ul2 (#388)
Browse files Browse the repository at this point in the history
* For some models like Mistral and Flan-UL2, when downloaded from the hub the binary files write to a snapshots/<uuid> subdirectory. Then when the files are committed, they cannot be found and the commit fails with an error.

* Changed `local.split("/")[-1]` to os.path.basename(local) for compatibility with all OS including Windows.

* Removed snapshots section

* Removed additional line break.

---------

Co-authored-by: Lachlan Cahill <[email protected]>
  • Loading branch information
lachlancahill and Lachlan Cahill authored Nov 27, 2023
1 parent 08dd5f2 commit 9c81742
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bindings/python/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def convert_multi(
local_filenames.append(index)

operations = [
CommitOperationAdd(path_in_repo=local.split("/")[-1], path_or_fileobj=local) for local in local_filenames
CommitOperationAdd(path_in_repo=os.path.basename(local), path_or_fileobj=local) for local in local_filenames
]
errors: List[Tuple[str, "Exception"]] = []

Expand Down

0 comments on commit 9c81742

Please sign in to comment.