Skip to content

Commit 7c1189f

Browse files
authored
Merge pull request #133 from Azure-Samples/addencoding
Add missing encoding
2 parents 118e2a0 + 8f738e1 commit 7c1189f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ description = "Evaluate chat applications using Azure OpenAI evaluators"
1919
dependencies = [
2020
"requests",
2121
"python-dotenv",
22-
"azure-ai-generative[evaluate]==1.0.0b11",
2322
"azure-ai-evaluation==1.5.0",
2423
"marshmallow==3.23.2", # Older version required due to promptflow issue with _T import
2524
"azure-search-documents",

src/evaltools/review/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def summarize_results(results_dir):
1212
folders = [f for f in os.listdir(results_dir) if os.path.isdir(os.path.join(results_dir, f))]
1313
folders.sort()
1414
for folder in folders:
15-
with open(Path(results_dir) / folder / "summary.json") as f:
15+
with open(Path(results_dir) / folder / "summary.json", encoding="utf-8") as f:
1616
summary = json.load(f)
1717
run_summaries[folder] = summary
1818
# first find the common parameters across the runs
@@ -62,10 +62,10 @@ def summarize_results(results_dir):
6262
run_row.append(summary[metric_name][stat])
6363
else:
6464
run_row.append("?")
65-
with open(Path(results_dir) / folder / "eval_results.jsonl") as f:
65+
with open(Path(results_dir) / folder / "eval_results.jsonl", encoding="utf-8") as f:
6666
run_row.append(sum(1 for _ in f))
6767
rows.append(run_row)
68-
with open(Path(results_dir) / folder / "evaluate_parameters.json") as f:
68+
with open(Path(results_dir) / folder / "evaluate_parameters.json", encoding="utf-8") as f:
6969
row_parameters[folder] = json.load(f)
7070

7171
return rows, row_parameters
@@ -74,7 +74,7 @@ def summarize_results(results_dir):
7474
def diff_directories(directories: list[Path], changed: str | None = None):
7575
data_dicts = []
7676
for directory in directories:
77-
with open(directory / "eval_results.jsonl") as f:
77+
with open(directory / "eval_results.jsonl", encoding="utf-8") as f:
7878
data_json = [json.loads(question_json) for question_json in f.readlines()]
7979
data_dicts.append({question["question"]: question for question in data_json})
8080
if changed:

0 commit comments

Comments
 (0)