Spaces:
Running
Running
Commit ·
ae129df
1
Parent(s): f2456ca
fix: use as_posix() for HF repo paths (Windows backslash bug in upload)
Browse files
scripts/upload_models_to_hub.py
CHANGED
|
@@ -171,10 +171,9 @@ def main():
|
|
| 171 |
|
| 172 |
for subdir in subdirs:
|
| 173 |
rel = subdir.relative_to(version_path)
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
if
|
| 177 |
-
repo_path = version
|
| 178 |
|
| 179 |
files_in_sub = [
|
| 180 |
f for f in subdir.iterdir()
|
|
|
|
| 171 |
|
| 172 |
for subdir in subdirs:
|
| 173 |
rel = subdir.relative_to(version_path)
|
| 174 |
+
# Use as_posix() to ensure forward slashes on Windows
|
| 175 |
+
rel_posix = rel.as_posix()
|
| 176 |
+
repo_path = version if rel_posix == "." else f"{version}/{rel_posix}"
|
|
|
|
| 177 |
|
| 178 |
files_in_sub = [
|
| 179 |
f for f in subdir.iterdir()
|