(ctx, **kwargs)
\b
    - DESCRIPTION:
        Get the template of predict config.

    \b
    - USAGE:
        flow model get-predict-conf --model-id $MODEL_ID --model-version $MODEL_VERSION -o ./examples/
\b
    - DESCRIPTION:
        Get the template of predict config.
\ b - DESCRIPTION : Get the template of predict config .
def get_predict_conf(ctx, **kwargs):
    """
    \b
    - DESCRIPTION:
        Get the template of predict config.

    \b
    - USAGE:
        flow model get-predict-conf --model-id $MODEL_ID --model-version $MODEL_VERSION -o ./examples/

    """
    config_data, dsl_data = preprocess(**kwargs)
    conf_filename = "predict_conf_{}.json".format(datetime.now().strftime('%Y%m%d%H%M%S'))
    output_path = os.path.join(check_abs_path(kwargs.get("output_path")), conf_filename)
    config_data["filename"] = conf_filename

    with closing(access_server('post', ctx, 'model/get/predict/conf', config_data, False, stream=True)) as response:
        if response.status_code == 200:
            os.makedirs(os.path.dirname(output_path), exist_ok=True)
            with open(output_path, "wb") as fw:
                for chunk in response.iter_content(1024):
                    if chunk:
                        fw.write(chunk)
            res = {'retcode': 0,
                   'retmsg': "Query predict conf successfully. "
                             "File path is: {}".format(output_path)}
        else:
            try:
                res = response.json() if isinstance(response, requests.models.Response) else response
            except Exception:
                res = {'retcode': 100,
                       'retmsg': "Query predict conf failed."
                                 "For more details, please check logs/fate_flow/fate_flow_stat.log"}
    prettify(res)
def get_predict_conf ( ctx , * * kwargs ) : config_data , dsl_data = preprocess ( * * kwargs ) conf_filename = "predict_conf_{}.json" . format ( datetime . now ( ) . strftime ( '%Y%m%d%H%M%S' ) ) output_path = os . path . join ( check_abs_path ( kwargs . get ( "output_path" ) ) , conf_filename ) config_data [ "filename" ] = conf_filename with closing ( access_server ( 'post' , ctx , 'model/get/predict/conf' , config_data , False , stream = True ) ) as response : if response . status_code == 200 : os . makedirs ( os . path . dirname ( output_path ) , exist_ok = True ) with open ( output_path , "wb" ) as fw : for chunk in response . iter_content ( 1024 ) : if chunk : fw . write ( chunk ) res = { 'retcode' : 0 , 'retmsg' : "Query predict conf successfully. " "File path is: {}" . format ( output_path ) } else : try : res = response . json ( ) if isinstance ( response , requests . models . Response ) else response except Exception : res = { 'retcode' : 100 , 'retmsg' : "Query predict conf failed." "For more details, please check logs/fate_flow/fate_flow_stat.log" } prettify ( res )