ultralytics 8.1.44 add IS_RASPBERRYPI and constants refactor (#9827)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
3f34a7c3af
commit
7d891a4aa4
43 changed files with 146 additions and 141 deletions
|
|
@ -3,7 +3,7 @@
|
|||
import requests
|
||||
|
||||
from ultralytics.hub.utils import HUB_API_ROOT, HUB_WEB_ROOT, PREFIX, request_with_credentials
|
||||
from ultralytics.utils import LOGGER, SETTINGS, emojis, is_colab
|
||||
from ultralytics.utils import IS_COLAB, LOGGER, SETTINGS, emojis
|
||||
|
||||
API_KEY_URL = f"{HUB_WEB_ROOT}/settings?tab=api+keys"
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ class Auth:
|
|||
# Attempt to authenticate with the provided API key
|
||||
success = self.authenticate()
|
||||
# If the API key is not provided and the environment is a Google Colab notebook
|
||||
elif is_colab():
|
||||
elif IS_COLAB:
|
||||
# Attempt to authenticate using browser cookies
|
||||
success = self.auth_with_cookies()
|
||||
else:
|
||||
|
|
@ -109,7 +109,7 @@ class Auth:
|
|||
Returns:
|
||||
(bool): True if authentication is successful, False otherwise.
|
||||
"""
|
||||
if not is_colab():
|
||||
if not IS_COLAB:
|
||||
return False # Currently only works with Colab
|
||||
try:
|
||||
authn = request_with_credentials(f"{HUB_API_ROOT}/v1/auth/auto")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue