Skip to content

Commit 2663eec

Browse files
committed
Fix test
1 parent 2ad5299 commit 2663eec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

patches/kaggle_module_resolver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ def _is_on_kaggle_notebook():
1111
return os.getenv("KAGGLE_KERNEL_RUN_TYPE") != None and os.getenv("KAGGLE_USER_SECRETS_TOKEN") != None
1212

1313
def _is_kaggle_handle(handle):
14-
return url_pattern.match(handle) != None
14+
return long_url_pattern.match(handle) != None or short_url_pattern.match(handle) != None
1515

1616
class KaggleFileResolver(resolver.HttpResolverBase):
1717
def is_supported(self, handle):
1818
return _is_on_kaggle_notebook() and _is_kaggle_handle(handle)
1919

2020
def __call__(self, handle):
2121
m = long_url_pattern.match(handle) or short_url_pattern.match(handle)
22-
return kagglehub.model_download(f"{m.group('owner')}/{m.group('model')}/{m.group('framework').lower()}/{m.group('variation')}/{m.group('version')}")
22+
return kagglehub.model_download(f"{m.group('owner')}/{m.group('model')}/{m.group('framework').lower()}/{m.group('variation')}/{m.group('version')}")

0 commit comments

Comments
 (0)