Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made into a pytest.fixture #296

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Made into a pytest.fixture
  • Loading branch information
RohitRathore1 committed Jan 18, 2024
commit 7ec7d725154e797b785687440b084bd91f5940a1
8 changes: 3 additions & 5 deletions tests/test_smoke_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
]


# TODO make into a pytest.fixture?
@pytest.fixture
def setup_elicit(
tmp_path: Path,
dataset_name="imdb",
model_path="sshleifer/tiny-gpt2",
tmp_path: Path, dataset_name="imdb", model_path="sshleifer/tiny-gpt2"
) -> Elicit:
"""Setup elicit config for testing, execute elicit, and save output to tmp_path.
Returns the elicit run configuration.
Expand Down Expand Up @@ -114,7 +112,7 @@ def eval_assert_files_good(elicit: Elicit, transfer_datasets: tuple[str, ...] =


@pytest.mark.gpu
def test_smoke_eval_run_tiny_gpt2(tmp_path: Path):
def test_smoke_eval_run_tiny_gpt2(tmp_path: Path, setup_elicit):
elicit = setup_elicit(tmp_path)
transfer_datasets = ("christykoh/imdb_pt",)
eval_run(elicit, transfer_datasets=transfer_datasets)
Expand Down