ultralytics 8.0.69 HUB CI and ClearML fixes (#1888)
Co-authored-by: Victor Sonck <victor.sonck@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
d3f097314f
commit
c2cd3fd20e
6 changed files with 67 additions and 88 deletions
|
|
@ -13,7 +13,7 @@ import requests
|
|||
from tqdm import tqdm
|
||||
|
||||
from ultralytics.yolo.utils import (ENVIRONMENT, LOGGER, ONLINE, RANK, SETTINGS, TESTS_RUNNING, TQDM_BAR_FORMAT,
|
||||
TryExcept, __version__, colorstr, emojis, get_git_origin_url, is_colab, is_git_dir,
|
||||
TryExcept, __version__, colorstr, get_git_origin_url, is_colab, is_git_dir,
|
||||
is_pip_package)
|
||||
|
||||
PREFIX = colorstr('Ultralytics HUB: ')
|
||||
|
|
@ -80,29 +80,6 @@ def request_with_credentials(url: str) -> any:
|
|||
return output.eval_js('_hub_tmp')
|
||||
|
||||
|
||||
def split_key(key=''):
|
||||
"""
|
||||
Verify and split a 'api_key[sep]model_id' string, sep is one of '.' or '_'
|
||||
|
||||
Args:
|
||||
key (str): The model key to split. If not provided, the user will be prompted to enter it.
|
||||
|
||||
Returns:
|
||||
Tuple[str, str]: A tuple containing the API key and model ID.
|
||||
"""
|
||||
|
||||
import getpass
|
||||
|
||||
error_string = emojis(f'{PREFIX}Invalid API key ⚠️\n') # error string
|
||||
if not key:
|
||||
key = getpass.getpass('Enter model key: ')
|
||||
sep = '_' if '_' in key else None # separator
|
||||
assert sep, error_string
|
||||
api_key, model_id = key.split(sep)
|
||||
assert len(api_key) and len(model_id), error_string
|
||||
return api_key, model_id
|
||||
|
||||
|
||||
def requests_with_progress(method, url, **kwargs):
|
||||
"""
|
||||
Make an HTTP request using the specified method and URL, with an optional progress bar.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue