@@ -101,12 +101,7 @@ def predict():
101101
102102@app .route ("/predict" , methods = ["GET" ])
103103def get_summary ():
104- return jsonify (
105- {
106- "model_signature" : extract_signature (local_cache ["input_metadata" ]),
107- "message" : api_utils .API_SUMMARY_MESSAGE ,
108- }
109- )
104+ return jsonify ({"message" : api_utils .API_SUMMARY_MESSAGE })
110105
111106
112107@app .errorhandler (Exception )
@@ -126,7 +121,7 @@ def start(args):
126121 if api .get ("predictor" ) is None :
127122 raise CortexException (api ["name" ], "predictor key not configured" )
128123
129- cx_logger ().info ("loading the Predictor from {}" .format (api ["predictor" ]["path" ]))
124+ cx_logger ().info ("loading the predictor from {}" .format (api ["predictor" ]["path" ]))
130125 local_cache ["predictor" ] = ctx .get_predictor_impl (api ["name" ], args .project_dir )
131126
132127 if util .has_function (local_cache ["predictor" ], "init" ):
@@ -138,7 +133,7 @@ def start(args):
138133 args .model_dir , os .path .basename (os .path .normpath (prefix ))
139134 )
140135
141- cx_logger ().info ("calling the Predictor 's init() function" )
136+ cx_logger ().info ("calling the predictor 's init() function" )
142137 local_cache ["predictor" ].init (model_path , api ["predictor" ]["metadata" ])
143138 except Exception as e :
144139 raise UserRuntimeException (api ["predictor" ]["path" ], "init" , str (e )) from e
@@ -154,24 +149,24 @@ def start(args):
154149 except Exception as e :
155150 cx_logger ().warn ("an error occurred while attempting to load classes" , exc_info = True )
156151
157- cx_logger ().info ("{} API is live" .format (api ["name" ]))
152+ cx_logger ().info ("{} api is live" .format (api ["name" ]))
158153 serve (app , listen = "*:{}" .format (args .port ))
159154
160155
161156def main ():
162157 parser = argparse .ArgumentParser ()
163158 na = parser .add_argument_group ("required named arguments" )
164- na .add_argument ("--workload-id" , required = True , help = "Workload ID " )
165- na .add_argument ("--port" , type = int , required = True , help = "Port (on localhost) to use" )
159+ na .add_argument ("--workload-id" , required = True , help = "workload id " )
160+ na .add_argument ("--port" , type = int , required = True , help = "port (on localhost) to use" )
166161 na .add_argument (
167162 "--context" ,
168163 required = True ,
169- help = "S3 path to context (e.g. s3://bucket/path/to/context.json)" ,
164+ help = "s3 path to context (e.g. s3://bucket/path/to/context.json)" ,
170165 )
171- na .add_argument ("--api" , required = True , help = "Resource id of api to serve" )
172- na .add_argument ("--model-dir" , required = True , help = "Directory to download the model to" )
173- na .add_argument ("--cache-dir" , required = True , help = "Local path for the context cache" )
174- na .add_argument ("--project-dir" , required = True , help = "Local path for the project zip file" )
166+ na .add_argument ("--api" , required = True , help = "resource id of api to serve" )
167+ na .add_argument ("--model-dir" , required = True , help = "directory to download the model to" )
168+ na .add_argument ("--cache-dir" , required = True , help = "local path for the context cache" )
169+ na .add_argument ("--project-dir" , required = True , help = "local path for the project zip file" )
175170
176171 parser .set_defaults (func = start )
177172
0 commit comments