* 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 <lachlan.cahill@gmail.com>
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"]] = []