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

#27 Fix obj serialization for saving #29

Merged
merged 9 commits into from
Oct 29, 2024
Merged

#27 Fix obj serialization for saving #29

merged 9 commits into from
Oct 29, 2024

Conversation

minaamshahid
Copy link
Collaborator

Fixes #27

@minaamshahid minaamshahid requested a review from bergr7 October 25, 2024 06:46
Copy link

codecov bot commented Oct 25, 2024

Codecov Report

Attention: Patch coverage is 57.91246% with 125 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
flow_judge/utils/result_writer.py 0.00% 58 Missing ⚠️
flow_judge/integrations/llama_index.py 0.00% 40 Missing ⚠️
flow_judge/flow_judge.py 0.00% 23 Missing ⚠️
flow_judge/models/vllm.py 0.00% 3 Missing ⚠️
flow_judge/eval_data_types.py 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
...sts/e2e-local/integrations/test_llama_index_e2e.py 91.26% <100.00%> (-0.40%) ⬇️
tests/unit/models/test_baseten.py 90.09% <100.00%> (+0.04%) ⬆️
tests/unit/utils/test_result_writer.py 100.00% <100.00%> (ø)
flow_judge/eval_data_types.py 0.00% <0.00%> (ø)
flow_judge/models/vllm.py 0.00% <0.00%> (ø)
flow_judge/flow_judge.py 0.00% <0.00%> (ø)
flow_judge/integrations/llama_index.py 0.00% <0.00%> (ø)
flow_judge/utils/result_writer.py 0.00% <0.00%> (ø)

@sariola sariola self-requested a review October 25, 2024 09:22
@sariola
Copy link
Collaborator

sariola commented Oct 25, 2024

Added stronger, more defensive input checks for the result_writer and unit tests.
Robustness improvements to the file name encoding.

- Ensures non-ASCII characters are preserved in the output.
"""
if len(eval_inputs) != len(eval_outputs):
raise ValueError("eval_inputs and eval_outputs must have the same length")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This will likely raise an error if there have been downstream errors with outputs. Eval outputs can be <= eval_inputs

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks Minaam, it's the zip function below that needs them to be the same lengths. This check is just to throw the right error type.

I'll see what I could do.

image

@minaamshahid
Copy link
Collaborator Author

Great updates!

@sariola
Copy link
Collaborator

sariola commented Oct 25, 2024

I've pushed 'append' style result_writing for batches and end-to-end test for result writing with Llama-Index.

I still need to test a bit more and understand what makes the most sense.

def _handle_batch_result(
self, batch_result: BatchResult, batch_len: int, fail_on_parse_error: bool
) -> list[EvalOutput]:
"""Handle output parsing for batched results from Baseten.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is probably for all model instances not just for baseten right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

True, updated!

@minaamshahid
Copy link
Collaborator Author

@sariola Pushed the update for downstream errors!

@sariola sariola merged commit f143379 into main Oct 29, 2024
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Result saving fails because ModelType is not serializable
3 participants