aws / fmeval

Foundation Model Evaluations Library
http://aws.github.io/fmeval
Apache License 2.0
214 stars 46 forks source link

fix: fix logic in evaluate_dataset to handle BYO inference outputs use case #252

Closed danielezhu closed 7 months ago

danielezhu commented 7 months ago

Description of changes: Currently, the evaluate_dataset utility function (which gets called by the majority of the evaluation algorithms' evaluate method) assumes that if the ModelRunner passed to it is non-null, this means that model outputs should be obtained. However, this assumption does not hold for some users who provide a dataset with model outputs, but call evaluate with a non-null ModelRunner anyway.

This PR changes the conditional logic in evaluate_dataset such that the BYO inference outputs use case above is supported.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.