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
2b566c18
"examples/run_classifier.py" did not exist on "cd09cd5b40fa9ccab1a40643bd5cf1245fcc4a2c"
Unverified
Commit
2b566c18
authored
Jan 14, 2020
by
Thomas Wolf
Committed by
GitHub
Jan 14, 2020
Browse files
Merge pull request #2384 from dimagalat/master
Releasing file lock
parents
896a0eb1
2926852f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
src/transformers/file_utils.py
src/transformers/file_utils.py
+8
-11
No files found.
src/transformers/file_utils.py
View file @
2b566c18
...
@@ -385,16 +385,13 @@ def get_from_cache(
...
@@ -385,16 +385,13 @@ def get_from_cache(
else
:
else
:
http_get
(
url
,
temp_file
,
proxies
=
proxies
,
resume_size
=
resume_size
,
user_agent
=
user_agent
)
http_get
(
url
,
temp_file
,
proxies
=
proxies
,
resume_size
=
resume_size
,
user_agent
=
user_agent
)
# we are copying the file before closing it, so flush to avoid truncation
logger
.
info
(
"storing %s in cache at %s"
,
url
,
cache_path
)
temp_file
.
flush
()
os
.
rename
(
temp_file
.
name
,
cache_path
)
logger
.
info
(
"storing %s in cache at %s"
,
url
,
cache_path
)
logger
.
info
(
"creating metadata file for %s"
,
cache_path
)
os
.
rename
(
temp_file
.
name
,
cache_path
)
meta
=
{
"url"
:
url
,
"etag"
:
etag
}
meta_path
=
cache_path
+
".json"
logger
.
info
(
"creating metadata file for %s"
,
cache_path
)
with
open
(
meta_path
,
"w"
)
as
meta_file
:
meta
=
{
"url"
:
url
,
"etag"
:
etag
}
json
.
dump
(
meta
,
meta_file
)
meta_path
=
cache_path
+
".json"
with
open
(
meta_path
,
"w"
)
as
meta_file
:
json
.
dump
(
meta
,
meta_file
)
return
cache_path
return
cache_path
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