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

Open
Sprizgola opened this issue Dec 23, 2024 · 0 comments
Labels
bug Something isn't working c/evals triage issues that need triage

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
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 triage issues that need triage
Projects
Status: 📘 Todo
Development

No branches or pull requests

1 participant