From 9c817427df7e4635b60a9a1f8b8ffc5d74843576 Mon Sep 17 00:00:00 2001 From: lachlancahill <51102701+lachlancahill@users.noreply.github.com> Date: Tue, 28 Nov 2023 02:58:28 +1300 Subject: [PATCH] Fix/errors for some models including Mistral-7b and Flan-ul2 (#388) * For some models like Mistral and Flan-UL2, when downloaded from the hub the binary files write to a snapshots/ 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 --- bindings/python/convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/convert.py b/bindings/python/convert.py index 164f8f5b..3a2e4d1f 100644 --- a/bindings/python/convert.py +++ b/bindings/python/convert.py @@ -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"]] = []