Skip to content

When using the local metrics with prompt getting Key Error during evaluation - values returning as None #77

Description

@guild-ttreece

Please provide us with the following information:

This issue is for a: (mark with an x)

- [X ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Change from built-in metrics to custom metrics listed in the scripts\evaluate_metrics\prompts folder. Modify example_config.json to contain:

Any log messages given by the failure

raise KeyError(f"None of [{key}] are in the [{axis_name}]")
KeyError: "None of [Index(['relevance_score'], dtype='object')] are in the [columns]"

Expected/desired behavior

Jinja prompt templates to be used and evaluated with scores and then evaluated.

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
Windows 11

Versions

v22H2

Mention any other details that might be useful

I am using the same test data path and the only change I am making is to use the local prompt via the Jinja2 templates. My goal is to be able to customize the metrics to my use case and add additional metrics as well but am encountering this issue whenever attempting to use a non-built-in metric.

Here is an example of the metric response received:

'latency': 9.598966, 'relevance': None, 'answer_length': 615, 'gpt_coherence': 5, 'gpt_groundedness': 5, 'gpt_groundedness_reason': '(Failed)'

"Relevance" is the metric changed to use the local prompt that where it seems to have an issue with the value, although this has happened when attempting to utilize any of the local prompts.


Thanks! We'll be in touch soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions