Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions src/lighteval/models/endpoints/litellm_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,14 @@ def greedy_until(

for response, context in zip(responses, contexts):
result: list[str] = [choice.message.content for choice in response.choices]
reasonings: list[str | None] = [
getattr(choice.message, "reasoning_content", None) for choice in response.choices
]

cur_response = ModelResponse(
# In empty responses, the model should return an empty string instead of None
text=result if result[0] else [""],
reasonings=reasonings,
input=context,
)
results.append(cur_response)
Expand Down
1 change: 1 addition & 0 deletions src/lighteval/models/model_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class ModelResponse:
text: list[str] = field(default_factory=list) # The text of the response
output_tokens: list[list[int]] = field(default_factory=list) # Model generations
text_post_processed: list[str] | None = None # The text of the response postprocessed
reasonings: list[str | None] = field(default_factory=list) # The reasoning content of the response

# Model logprob outputs
logprobs: list[float] = field(default_factory=list) # Log probabilities of the response
Expand Down
Loading