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

Fixed issue with o1 in litellm. #493

Merged
merged 1 commit into from
Jan 20, 2025
Merged
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
11 changes: 7 additions & 4 deletions src/lighteval/models/litellm_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(self, config, env_config) -> None:
self._tokenizer = encode
self.pairwise_tokenization = False
litellm.drop_params = True
litellm.verbose = True
litellm.set_verbose = False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the verbose vs set_verbose a typo on our end or does it depend on the litellm version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume it is the litellm version. I suggest litellm 1.50 since in later versions together_ai models experience issues.


def _prepare_stop_sequence(self, stop_sequence):
"""Prepare and validate stop sequence."""
Expand Down Expand Up @@ -130,13 +130,16 @@ def __call_api(self, prompt, return_logits, max_new_tokens, num_samples, stop_se
"messages": prompt,
"max_completion_tokens": max_new_tokens,
"logprobs": return_logits if self.provider == "openai" else None,
"stop": stop_sequence,
"base_url": self.base_url,
"n": num_samples,
"temperature": self.TEMPERATURE,
"top_p": self.TOP_P,
"caching": True,
}
if "o1" in self.model:
logger.warning("O1 models do not support temperature, top_p, stop sequence. Disabling.")
else:
kwargs["temperature"] = self.TEMPERATURE
kwargs["top_p"] = self.TOP_P
kwargs["stop"] = stop_sequence

response = litellm.completion(**kwargs)

Expand Down
Loading