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
e5812462
"...csrc/git@developer.sourcefind.cn:change/sglang.git" did not exist on "737d73ed5bcb5cd161c142551c7e43257e8aa130"
Commit
e5812462
authored
Dec 20, 2019
by
thomwolf
Browse files
clean up debug and less verbose tqdm
parent
4775ec35
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
transformers/file_utils.py
transformers/file_utils.py
+2
-1
transformers/pipelines.py
transformers/pipelines.py
+0
-1
No files found.
transformers/file_utils.py
View file @
e5812462
...
@@ -287,7 +287,8 @@ def http_get(url, temp_file, proxies=None, resume_size=0, user_agent=None):
...
@@ -287,7 +287,8 @@ def http_get(url, temp_file, proxies=None, resume_size=0, user_agent=None):
return
return
content_length
=
response
.
headers
.
get
(
'Content-Length'
)
content_length
=
response
.
headers
.
get
(
'Content-Length'
)
total
=
resume_size
+
int
(
content_length
)
if
content_length
is
not
None
else
None
total
=
resume_size
+
int
(
content_length
)
if
content_length
is
not
None
else
None
progress
=
tqdm
(
unit
=
"B"
,
unit_scale
=
True
,
total
=
total
,
initial
=
resume_size
,
desc
=
"Downloading"
)
progress
=
tqdm
(
unit
=
"B"
,
unit_scale
=
True
,
total
=
total
,
initial
=
resume_size
,
desc
=
"Downloading"
,
disable
=
bool
(
logger
.
level
<=
logging
.
INFO
))
for
chunk
in
response
.
iter_content
(
chunk_size
=
1024
):
for
chunk
in
response
.
iter_content
(
chunk_size
=
1024
):
if
chunk
:
# filter out keep-alive new chunks
if
chunk
:
# filter out keep-alive new chunks
progress
.
update
(
len
(
chunk
))
progress
.
update
(
len
(
chunk
))
...
...
transformers/pipelines.py
View file @
e5812462
...
@@ -171,7 +171,6 @@ class CsvPipelineDataFormat(PipelineDataFormat):
...
@@ -171,7 +171,6 @@ class CsvPipelineDataFormat(PipelineDataFormat):
with
open
(
self
.
input_path
,
'r'
)
as
f
:
with
open
(
self
.
input_path
,
'r'
)
as
f
:
reader
=
csv
.
DictReader
(
f
)
reader
=
csv
.
DictReader
(
f
)
for
row
in
reader
:
for
row
in
reader
:
print
(
row
,
self
.
column
)
if
self
.
is_multi_columns
:
if
self
.
is_multi_columns
:
yield
{
k
:
row
[
c
]
for
k
,
c
in
self
.
column
}
yield
{
k
:
row
[
c
]
for
k
,
c
in
self
.
column
}
else
:
else
:
...
...
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