Skip to content

Commit

Permalink
Fix for test_gen (guidance-ai#695)
Browse files Browse the repository at this point in the history
A recent merge had not picked up on changes to test infrastructure.
  • Loading branch information
riedgar-ms authored Mar 15, 2024
1 parent 793821b commit 7873d33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/library/test_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ def test_stop_char():
lm += "Count to 10: 1, 2, 3, 4, 5, 6, 7, " + gen('text', stop=",")
assert lm["text"] == "8"

def test_stop_list_side_effect():
def test_stop_list_side_effect(selected_model):
'''Tests a bug where a stop list has an item appended to it in place instead of being updated non-destructively. The bug only occurs whe regex is also None'''
stop_list = ['\nStep', '\n\n', '\nAnswer'];
stop_list_length = len(stop_list);
lm = get_model("transformers:gpt2")
lm = selected_model
lm + '''Question: Josh decides to try flipping a house.  He buys a house for $80,000 and then puts in $50,000 in repairs.  This increased the value of the house by 150%.  How much profit did he make?
Let's think step by step, and then write the answer:
Step 1''' + gen('steps', list_append=True, stop=['\nStep', '\n\n', '\nAnswer'], temperature=0.7, max_tokens=20) + '\n'
Expand Down

0 comments on commit 7873d33

Please sign in to comment.