Unverified Commit fe974e6b authored by liuzhe-lz's avatar liuzhe-lz Committed by GitHub
Browse files

Make standalone mode warning more obvious (#3312)

parent 8134be62
# Copyright (c) Microsoft Corporation. # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license. # Licensed under the MIT license.
import colorama
import logging import logging
import warnings
import json_tricks import json_tricks
__all__ = [ __all__ = [
...@@ -16,7 +18,16 @@ _logger = logging.getLogger('nni') ...@@ -16,7 +18,16 @@ _logger = logging.getLogger('nni')
def get_next_parameter(): def get_next_parameter():
_logger.warning('Requesting parameter without NNI framework, returning empty dict') warning_message = ''.join([
colorama.Style.BRIGHT,
colorama.Fore.RED,
'Running NNI code without runtime. ',
'Check the following tutorial if you are new to NNI: ',
colorama.Fore.YELLOW,
'https://nni.readthedocs.io/en/stable/Tutorial/QuickStart.html#id1',
colorama.Style.RESET_ALL
])
warnings.warn(warning_message, RuntimeWarning)
return { return {
'parameter_id': None, 'parameter_id': None,
'parameters': {} 'parameters': {}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment