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
d8293e84
Commit
d8293e84
authored
Dec 27, 2019
by
Julien Chaumond
Browse files
[cli] upload: max number of files at the same time
parent
4d6c93e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
src/transformers/commands/user.py
src/transformers/commands/user.py
+11
-0
No files found.
src/transformers/commands/user.py
View file @
d8293e84
...
...
@@ -9,6 +9,9 @@ from transformers.commands import BaseTransformersCLICommand
from
transformers.hf_api
import
HfApi
,
HfFolder
UPLOAD_MAX_FILES
=
15
class
UserCommands
(
BaseTransformersCLICommand
):
@
staticmethod
def
register_subcommand
(
parser
:
ArgumentParser
):
...
...
@@ -180,6 +183,14 @@ class UploadCommand(BaseUserCommand):
else
:
raise
ValueError
(
"Not a valid file or directory: {}"
.
format
(
local_path
))
if
len
(
files
)
>
UPLOAD_MAX_FILES
:
print
(
"About to upload {} files to S3. This is probably wrong. Please filter files before uploading."
.
format
(
ANSI
.
bold
(
len
(
files
))
)
)
exit
(
1
)
for
filepath
,
filename
in
files
:
print
(
"About to upload file {} to S3 under filename {}"
.
format
(
ANSI
.
bold
(
filepath
),
ANSI
.
bold
(
filename
)))
...
...
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