fixed GPT-2 tokenization on python 2

This commit is contained in:
thomwolf
2019-04-17 10:56:15 +02:00
parent bdaba1897c
commit bc70779bf0
4 changed files with 7 additions and 5 deletions

View File

@@ -227,7 +227,7 @@ def get_from_cache(url, cache_dir=None):
meta = {'url': url, 'etag': etag}
meta_path = cache_path + '.json'
with open(meta_path, 'w', encoding="utf-8") as meta_file:
json.dump(meta, meta_file)
meta_file.write(json.dumps(meta))
logger.info("removing temp file %s", temp_file.name)