Skip to content

Commit

Permalink
test typo
Browse files Browse the repository at this point in the history
  • Loading branch information
StanChan03 committed Dec 27, 2024
1 parent 20d7dea commit 2ad4ce2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/tests/lm_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,10 @@ def test_operator_cache(setup_models, model):
df = pd.DataFrame(data)
user_instruction = "What is a similar course to {Course Name}. Be concise?"

first_response = df.sem_map(df, user_instruction)
first_response = df.sem_map(user_instruction)
assert lm.stats.total_usage.operator_cache_hits == 0

second_response = df.sem_map(df, user_instruction)
second_response = df.sem_map(user_instruction)
assert lm.stats.total_usage.operator_cache_hits == 1

assert first_response == second_response
Expand All @@ -524,18 +524,18 @@ def test_disable_operator_cache(setup_models, model):
df = pd.DataFrame(data)
user_instruction = "What is a similar course to {Course Name}. Be concise?"

first_response = df.sem_map(df, user_instruction)
first_response = df.sem_map(user_instruction)
assert lm.stats.total_usage.operator_cache_hits == 0

second_response = df.sem_map(df, user_instruction)
second_response = df.sem_map(user_instruction)
assert lm.stats.total_usage.operator_cache_hits == 0

assert first_response == second_response

# Now enable operator cache. Note that the first batch is not cached.
lotus.settings.configure(enable_operator_cache=True)
first_responses = df.sem_map(df, user_instruction)
first_responses = df.sem_map(user_instruction)
assert lm.stats.total_usage.operator_cache_hits == 0
second_responses = df.sem_map(df, user_instruction)
second_responses = df.sem_map(user_instruction)
assert lm.stats.total_usage.operator_cache_hits == 1
assert first_responses == second_responses

0 comments on commit 2ad4ce2

Please sign in to comment.