Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
alckasoc committed Jul 13, 2024
1 parent 0352071 commit 8eb0d3a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/cog/self_refine/strategies/test_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ def test_generate() -> None:
)
assert answer == "Badr Hari"


def test_generate_critique() -> None:
"""Tests SelfRefineQAStrategy generate_critique."""
gt_critique = "1"
responses = [
"1"
]
responses = ["1"]
llm = FakeListChatModel(responses=responses)
strategy = SelfRefineQAStrategy(llm=llm)
question = 'Who was once considered the best kick boxer in the world, however he has been involved in a number of controversies relating to his "unsportsmanlike conducts" in the sport and crimes of violence outside of the ring'
Expand All @@ -70,9 +69,7 @@ def test_generate_critique() -> None:
# Test early stopping.
gt_critique = "1"
answer = "Mike Tyson"
responses = [
"1"
]
responses = ["1"]
llm = FakeListChatModel(responses=responses)
strategy = SelfRefineQAStrategy(llm=llm, patience=1)
strategy._prev_code_answer = "Mike Tyson"
Expand Down Expand Up @@ -117,6 +114,7 @@ def test_update_answer_based_on_critique() -> None:
)
assert new_answer == "1"


def test_halting_condition() -> None:
"""Tests SelfRefineQAStrategy halting_condition."""
llm = FakeListChatModel(responses=[])
Expand Down

0 comments on commit 8eb0d3a

Please sign in to comment.