Skip to content

Commit

Permalink
Removed relative path in test_lfrqa_env.py (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbraza authored Feb 27, 2025
1 parent 9d4f2a5 commit 8044692
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/lfrqa/tests/test_lfrqa_env.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import os
import pathlib

import pandas as pd

from aviary.envs.lfrqa.env import LFRQAPairwiseEvalEnv, LFRQAQuestion
from aviary.envs.lfrqa.task import LFRQATaskDataset

TESTS_DIR = pathlib.Path(__file__).parent
STUB_DATA_DIR = TESTS_DIR / "stub_data"


def test_env_construction() -> None:
data: list[LFRQAQuestion] = [
LFRQAQuestion(**row) # type: ignore[misc]
for row in pd.read_csv(
os.path.join("packages", "lfrqa", "tests", "stub_data", "mini_lfrqa.csv")
)[["qid", "question", "answer", "gold_doc_ids"]].to_dict(orient="records")
for row in pd.read_csv(STUB_DATA_DIR / "mini_lfrqa.csv")[
["qid", "question", "answer", "gold_doc_ids"]
].to_dict(orient="records")
]

dataset = LFRQATaskDataset(data=data)
Expand Down

0 comments on commit 8044692

Please sign in to comment.