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
3b0cecb6
Unverified
Commit
3b0cecb6
authored
Sep 19, 2022
by
Sylvain Gugger
Committed by
GitHub
Sep 19, 2022
Browse files
Don't warn of move if cache is empty (#19109)
parent
6be338f1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/transformers/utils/hub.py
src/transformers/utils/hub.py
+2
-1
No files found.
src/transformers/utils/hub.py
View file @
3b0cecb6
...
@@ -1104,8 +1104,9 @@ else:
...
@@ -1104,8 +1104,9 @@ else:
with
open
(
cache_version_file
)
as
f
:
with
open
(
cache_version_file
)
as
f
:
cache_version
=
int
(
f
.
read
())
cache_version
=
int
(
f
.
read
())
cache_is_not_empty
=
os
.
path
.
isdir
(
TRANSFORMERS_CACHE
)
and
len
(
os
.
listdir
(
TRANSFORMERS_CACHE
))
>
0
if
cache_version
<
1
:
if
cache_version
<
1
and
cache_is_not_empty
:
if
is_offline_mode
():
if
is_offline_mode
():
logger
.
warning
(
logger
.
warning
(
"You are offline and the cache for model files in Transformers v4.22.0 has been updated while your local "
"You are offline and the cache for model files in Transformers v4.22.0 has been updated while your local "
...
...
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