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
fa765202
Commit
fa765202
authored
Apr 17, 2019
by
thomwolf
Browse files
fix file_utils on python 2
parent
bcde2c61
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
pytorch_pretrained_bert/file_utils.py
pytorch_pretrained_bert/file_utils.py
+1
-1
No files found.
pytorch_pretrained_bert/file_utils.py
View file @
fa765202
...
@@ -227,7 +227,7 @@ def get_from_cache(url, cache_dir=None):
...
@@ -227,7 +227,7 @@ def get_from_cache(url, cache_dir=None):
meta
=
{
'url'
:
url
,
'etag'
:
etag
}
meta
=
{
'url'
:
url
,
'etag'
:
etag
}
meta_path
=
cache_path
+
'.json'
meta_path
=
cache_path
+
'.json'
with
open
(
meta_path
,
'w'
,
encoding
=
"utf-8"
)
as
meta_file
:
with
open
(
meta_path
,
'w'
,
encoding
=
"utf-8"
)
as
meta_file
:
meta_file
.
write
(
json
.
dump
s
(
meta
)
)
json
.
dump
(
meta
,
meta_file
)
logger
.
info
(
"removing temp file %s"
,
temp_file
.
name
)
logger
.
info
(
"removing temp file %s"
,
temp_file
.
name
)
...
...
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