examples/language_model/experimental/ernie/propeller/util.py
def parse_hparam(args=None):
    """get hparam from env or file"""
    if args is not None:
        hparam_strs = reduce(list.__add__, args.hparam)
    else:
        hparam_strs = [None]

    hparams = [
        _get_dict_from_environ_or_json_or_file(hp, 'PROPELLER_HPARAMS')
        for hp in hparam_strs
    ]
    hparams = [HParams(**h) for h in hparams if h is not None]
    if len(hparams) == 0:
        return HParams()
    else:
        hparam = reduce(lambda x, y: x.join(y), hparams)
        return hparam
get hparam from env or file
get hparam from env or file
get hparam from env or file
def parse_hparam(args=None):
    if args is not None:
        hparam_strs = reduce(list.__add__, args.hparam)
    else:
        hparam_strs = [None]
    hparams = [
        _get_dict_from_environ_or_json_or_file(hp, 'PROPELLER_HPARAMS')
        for hp in hparam_strs
    ]
    hparams = [HParams(**h) for h in hparams if h is not None]
    if len(hparams) == 0:
        return HParams()
    else:
        hparam = reduce(lambda x, y: x.join(y), hparams)
        return hparam
def parse_hparam ( args = None ) : if args is not None : hparam_strs = reduce ( list . __add__ , args . hparam ) else : hparam_strs = [ None ] hparams = [ _get_dict_from_environ_or_json_or_file ( hp , 'PROPELLER_HPARAMS' ) for hp in hparam_strs ] hparams = [ HParams ( ** h ) for h in hparams if h is not None ] if len ( hparams ) == 0 : return HParams ( ) else : hparam = reduce ( lambda x , y : x . join ( y ) , hparams ) return hparam
get hparam from env or file
get hparam from env or file
"""get hparam from env or file"""
args