File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ def handle_request(data):
5858
5959 if output_type .name not in loaded_model :
6060 loaded_model [output_type .name ] = dict ()
61-
61+ output_path = ""
6262 if energy_source not in loaded_model [output_type .name ]:
6363 output_path = get_download_output_path (download_path , power_request .energy_source , output_type )
6464 if not os .path .exists (output_path ):
@@ -82,8 +82,8 @@ def handle_request(data):
8282 model = loaded_model [output_type .name ][energy_source ]
8383 powers , msg = model .get_power (power_request .datapoint )
8484 if msg != "" :
85- print ("{} fail to predict, removed" .format (model .model_name ))
86- if os .path .exists (output_path ):
85+ print ("{} fail to predict, removed: {} " .format (model .model_name , msg ))
86+ if output_path != "" and os .path .exists (output_path ):
8787 shutil .rmtree (output_path )
8888 return {"powers" : powers , "msg" : msg }
8989
You can’t perform that action at this time.
0 commit comments