@@ -205,7 +205,6 @@ def _run_eval(
205205 try :
206206 Flow .parse_obj (version )
207207 except ValidationError :
208- logger .warning ("Invalid Flow `version` in your `file` request. Setting your version payload as flow `attributes`." )
209208 flow_version = {"attributes" : version }
210209 file_dict = {** file , ** flow_version }
211210 hl_file = client .flows .upsert (** file_dict )
@@ -307,11 +306,12 @@ def _run_eval(
307306 # Define the function to execute your function in parallel and Log to Humanloop
308307 def process_datapoint (datapoint : Datapoint ):
309308 start_time = datetime .now ()
309+ datapoint_dict = datapoint .dict ()
310310 try :
311- if datapoint . messages :
312- output = function_ (** datapoint . inputs , messages = datapoint . messages )
311+ if " messages" in datapoint_dict :
312+ output = function_ (** datapoint_dict [ " inputs" ] , messages = datapoint_dict [ " messages" ] )
313313 else :
314- output = function_ (** datapoint . inputs )
314+ output = function_ (** datapoint_dict [ " inputs" ] )
315315 if custom_logger :
316316 log = function_ (client = client , output = output )
317317 else :
@@ -340,7 +340,7 @@ def process_datapoint(datapoint: Datapoint):
340340 start_time = datetime .now ()
341341 eval_function = local_evaluator ["callable" ]
342342 if local_evaluator ["args_type" ] == "target_required" :
343- judgment = eval_function (log .dict (), datapoint . target )
343+ judgment = eval_function (log .dict (), datapoint_dict [ " target" ] )
344344 else :
345345 judgment = eval_function (log .dict ())
346346
@@ -375,7 +375,7 @@ def process_datapoint(datapoint: Datapoint):
375375
376376 # Generate locally if a file `callable` is provided
377377 if function_ :
378- logger .info (f"{ CYAN } \n Running { hl_file .name } { type_ } callable over { hl_dataset .name } { RESET } Dataset using { workers } workers" )
378+ logger .info (f"{ CYAN } \n Running { hl_file .name } over the Dataset { hl_dataset .name } using { workers } workers{ RESET } " )
379379 completed_tasks = 0
380380 with ThreadPoolExecutor (max_workers = workers ) as executor :
381381 futures = [
@@ -387,7 +387,7 @@ def process_datapoint(datapoint: Datapoint):
387387 _progress_bar (total_datapoints , completed_tasks )
388388 else :
389389 # TODO: trigger run when updated API is available
390- logger .info (f"{ CYAN } \n Running { type_ } { hl_file .name } over the Dataset { hl_dataset .name } { RESET } " )
390+ logger .info (f"{ CYAN } \n Running { hl_file .name } over the Dataset { hl_dataset .name } { RESET } " )
391391
392392 # Wait for the Evaluation to complete then print the results
393393 complete = False
@@ -471,7 +471,7 @@ def get_score_from_evaluator_stat(stat: Union[NumericStats, BooleanStats]) -> Un
471471 elif isinstance (stat , NumericStats ):
472472 score = round (stat .mean , 2 )
473473 else :
474- raise ValueError ( "Invalid Evaluator Stat type." )
474+ pass
475475 return score
476476
477477
0 commit comments