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

[BUG] 'ClassificationTemplate' object has no attribute 'explanation_template' #5815

Closed
Sprizgola opened this issue Dec 23, 2024 · 2 comments · Fixed by #5877
Closed

[BUG] 'ClassificationTemplate' object has no attribute 'explanation_template' #5815

Sprizgola opened this issue Dec 23, 2024 · 2 comments · Fixed by #5877
Assignees
Labels
bug Something isn't working c/evals

Comments

@Sprizgola
Copy link

Describe the bug
The variable explanation_template miss a default None value if it is not assigned.

To Reproduce
Steps to reproduce the behavior:

  1. import the class: from phoenix.evals.templates import ClassificationTemplate
  2. create a template without an explanation_template:
rails = ["correct", "incorrect"]
prompt_template = "prompt template ..... "
template = ClassificationTemplate(
    template= prompt_template, rails=rails
    )

  1. If the code is ran, this error will pop out:
    AttributeError: 'ClassificationTemplate' object has no attribute 'explanation_template'

If the explanation_template attribute is filled, no error occurs:

rails = ["correct", "incorrect"]
prompt_template = "prompt template ..... "
template = ClassificationTemplate(
    template= prompt_template, rails=rails, 
    explanation_template="Explaination: "
    )

Expected behavior
Because the attribute is not mandatory, the class should handle the missing value.

Screenshots
Error occurs in the red rectangle because the attribute has not been set in the yellow one.

Screenshot 2024-12-23 at 13 12 18

Environment (please complete the following information):

  • Version v7.3.0
@Sprizgola Sprizgola added bug Something isn't working triage issues that need triage labels Dec 23, 2024
@github-project-automation github-project-automation bot moved this to 📘 Todo in phoenix Dec 23, 2024
@dosubot dosubot bot added the c/evals label Dec 23, 2024
@mikeldking
Copy link
Contributor

@Sprizgola thanks for the catch. I think your right that it shouldn't be required if explanations are turned off. Will get the team to take a look.

@anticorrelator
Copy link
Contributor

hi @Sprizgola thanks for finding this! The fix for this can be tracked here: #5877 and should be released soon.

@github-project-automation github-project-automation bot moved this from 📘 Todo to ✅ Done in phoenix Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c/evals
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants