File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ class ScorerOutput(FlareModel):
133133 details : dict [str , Any ] = Field (
134134 default_factory = dict , description = "optional details about the scoring process"
135135 )
136- cost : float = 0
136+ cost : dict [ str , float ] = Field ( default_factory = dict )
137137
138138# TODO: would be better to have subclass of scorer, with custom details as pydantic model
139139
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ def __init__(self, message):
3030class MajorityVote (FlareModel ):
3131 decision : bool
3232 raw_responses : dict [str , dict ]
33- cost : float = 0
33+ cost : dict [ str , float ]
3434
3535
3636class MajorityVoteEvaluationModel (BaseModel ):
@@ -57,7 +57,7 @@ async def majority_vote(
5757 ]
5858 )
5959
60- evaluation_cost = 0
60+ evaluation_cost = {}
6161 for model , response in zip (self .models , responses ):
6262 try :
6363 response_json = extract_json_object (response .choices [0 ].message .content )
@@ -69,7 +69,7 @@ async def majority_vote(
6969 votes [model .litellm_model ]["reason" ] = response_json ["reason" ]
7070
7171 response_cost = response .model_dump ()["usage" ].get ("cost" , response ._hidden_params .get ("response_cost" , 0 ))
72- evaluation_cost + = response_cost
72+ evaluation_cost [ model . litellm_model ] = response_cost
7373
7474 except Exception as e :
7575 logging .error (
You can’t perform that action at this time.
0 commit comments