Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/unit/vertexai/test_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2925,6 +2925,9 @@ def test_rubric_generation_parsing_additional_fields(self):
critique_metric=metric_prompt_template_examples.MetricPromptTemplateExamples.Pointwise.COHERENCE,
)
dataset_with_rubrics = rbm.generate_rubrics(_TEST_EVAL_DATASET_PROMPT_RESPONSE)
expected = _EXPECTED_EVAL_DATASET_PROMPT_RESPONSE_WITH_RUBRICS
expected = _EXPECTED_EVAL_DATASET_PROMPT_RESPONSE_WITH_RUBRICS.copy()
expected["desc"] = ["test_desc", "test_desc", "test_desc"]
expected["desc"] = expected["desc"].astype(object)

assert dataset_with_rubrics.equals(expected)
assert dataset_with_rubrics.equals(expected)
2 changes: 1 addition & 1 deletion vertexai/evaluation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def _load_jsonl(filepath: str) -> "pd.DataFrame":
)
if filepath.startswith(_GCS_PREFIX):
file_contents = _read_gcs_file_contents(filepath)
return pd.read_json(file_contents, lines=True)
return pd.read_json(io.StringIO(file_contents), lines=True)
else:
with open(filepath, "r") as f:
return pd.read_json(f, lines=True)
Expand Down
Loading