Skip to content

Commit d2a7bc5

Browse files
committed
fix(tfhub): check for user secrets token in kaggle_module_resolver
1 parent a150398 commit d2a7bc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

patches/kaggle_module_resolver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
url_pattern = re.compile(r"https?://([a-z]+\.)?kaggle.com/models/(?P<owner>[^\\/]+)/(?P<model>[^\\/]+)/frameworks/(?P<framework>[^\\/]+)/variations/(?P<variation>[^\\/]+)/versions/(?P<version>[0-9]+)$")
88

99
def _is_on_kaggle_notebook():
10-
return os.getenv("KAGGLE_KERNEL_RUN_TYPE") != None
10+
return os.getenv("KAGGLE_KERNEL_RUN_TYPE") != None and os.getenv("KAGGLE_USER_SECRETS_TOKEN") != None
1111

1212
def _is_kaggle_handle(handle):
1313
return url_pattern.match(handle) != None

0 commit comments

Comments
 (0)