Skip to content

Commit

Permalink
made a mistake making template vars a set - order is not preserved
Browse files Browse the repository at this point in the history
  • Loading branch information
21ShisodeParth committed Jan 10, 2025
1 parent 7b9ded6 commit 524bd10
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/phoenix-evals/src/phoenix/evals/templates.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re
from collections import OrderedDict
from dataclasses import dataclass
from enum import Enum
from string import Formatter
Expand Down Expand Up @@ -149,7 +150,8 @@ def __init__(
for _template in [self.template, self.explanation_template]:
if _template:
self.variables.extend(self._parse_variables(template=_template))
self.variables = list(set(self.variables))
# remove duplicates while preserving order
self.variables = list(OrderedDict.fromkeys(self.variables))

self._scores = scores

Expand Down

0 comments on commit 524bd10

Please sign in to comment.