Unverified Commit 9b494a15 authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Don't hard error when cache version can't be converted to int (#22427)

parent 8252e24a
......@@ -1082,7 +1082,10 @@ if not os.path.isfile(cache_version_file):
cache_version = 0
else:
with open(cache_version_file) as f:
cache_version = int(f.read())
try:
cache_version = int(f.read())
except ValueError:
cache_version = 0
cache_is_not_empty = os.path.isdir(TRANSFORMERS_CACHE) and len(os.listdir(TRANSFORMERS_CACHE)) > 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment