Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
90b7df44
Commit
90b7df44
authored
Jan 22, 2020
by
Julien Chaumond
Browse files
Upload CLI: on win32, use slashes, not os.sep
parent
119dc50e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
src/transformers/commands/user.py
src/transformers/commands/user.py
+4
-0
No files found.
src/transformers/commands/user.py
View file @
90b7df44
import
os
import
os
import
sys
from
argparse
import
ArgumentParser
from
argparse
import
ArgumentParser
from
getpass
import
getpass
from
getpass
import
getpass
from
typing
import
List
,
Union
from
typing
import
List
,
Union
...
@@ -183,6 +184,9 @@ class UploadCommand(BaseUserCommand):
...
@@ -183,6 +184,9 @@ class UploadCommand(BaseUserCommand):
else
:
else
:
raise
ValueError
(
"Not a valid file or directory: {}"
.
format
(
local_path
))
raise
ValueError
(
"Not a valid file or directory: {}"
.
format
(
local_path
))
if
sys
.
platform
==
"win32"
:
files
=
[(
filepath
,
filename
.
replace
(
os
.
sep
,
"/"
))
for
filepath
,
filename
in
files
]
if
len
(
files
)
>
UPLOAD_MAX_FILES
:
if
len
(
files
)
>
UPLOAD_MAX_FILES
:
print
(
print
(
"About to upload {} files to S3. This is probably wrong. Please filter files before uploading."
.
format
(
"About to upload {} files to S3. This is probably wrong. Please filter files before uploading."
.
format
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment