@@ -121,8 +121,8 @@ async def post(self):
121121 @auth_or_token
122122 def get (self , prediction_id = None , action = None ):
123123 if action == 'download' :
124- pred_path = Prediction .get_if_owned_by (prediction_id ,
125- self . current_user ) .file_uri
124+ prediction = Prediction .get_if_owned_by (prediction_id , self . current_user )
125+ pred_path = prediction .file_uri
126126 fset , data = featurize .load_featureset (pred_path )
127127 result = pd .DataFrame (({'label' : data ['labels' ]}
128128 if len (data ['labels' ]) > 0 else None ),
@@ -133,8 +133,11 @@ def get(self, prediction_id=None, action=None):
133133 result ['prediction' ] = data ['preds' ]
134134 result .index .name = 'ts_name'
135135 self .set_header ("Content-Type" , 'text/csv; charset="utf-8"' )
136- self .set_header ("Content-Disposition" , "attachment; "
137- "filename=cesium_prediction_results.csv" )
136+ self .set_header (
137+ "Content-Disposition" , "attachment; "
138+ f"filename=cesium_prediction_results_{ prediction .project .name } "
139+ f"_{ prediction .dataset .name } "
140+ f"_{ prediction .model .name } _{ prediction .finished } .csv" )
138141 self .write (result .to_csv (index = True ))
139142 else :
140143 if prediction_id is None :
0 commit comments