Skip to content

Commit

Permalink
Update src/lighteval/models/litellm_model.py
Browse files Browse the repository at this point in the history
Co-authored-by: Nathan Habib <[email protected]>
  • Loading branch information
JoelNiklaus and NathanHB authored Feb 12, 2025
1 parent 923f036 commit 1a468b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lighteval/models/litellm_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def __call_api(self, prompt, return_logits, max_new_tokens, num_samples, stop_se
logger.info("Response is empty, retrying without caching")
response = litellm.completion(**kwargs)

if content and "<think>" in content:
if content is not None and "<think>" in content:
logger.debug(f"Removing <think> tags from response: {content}")
response.choices[0].message.content = re.sub(
r"<think>.*?</think>", "", content, flags=re.DOTALL
Expand Down

0 comments on commit 1a468b7

Please sign in to comment.