File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -2125,5 +2125,21 @@ def publish_ground_truths(
21252125 f" `{ inference_id_column_name } `. \n "
21262126 ) from None
21272127
2128- # TODO: Make POST request to publish ground truths
2129- print ("Publishing ground truths..." )
2128+ with tempfile .TemporaryDirectory () as tmp_dir :
2129+ # Copy save files to tmp dir
2130+ df .to_csv (f"{ tmp_dir } /dataset.csv" , index = False )
2131+ payload = {
2132+ "performGroundTruthMerge" : True ,
2133+ "groundTruthColumnName" : ground_truth_column_name ,
2134+ "inferenceIdColumnName" : inference_id_column_name ,
2135+ }
2136+
2137+ self .api .upload (
2138+ endpoint = f"inference-pipelines/{ inference_pipeline_id } /data" ,
2139+ file_path = f"{ tmp_dir } /dataset.csv" ,
2140+ object_name = "dataset.csv" ,
2141+ body = payload ,
2142+ storage_uri_key = "storageUri" ,
2143+ method = "POST" ,
2144+ )
2145+ print ("Ground truths published!" )
You can’t perform that action at this time.
0 commit comments