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

Issues with await #1833

Open
MichaelMMeskhi opened this issue Jan 10, 2025 · 1 comment
Open

Issues with await #1833

MichaelMMeskhi opened this issue Jan 10, 2025 · 1 comment
Labels
bug Something isn't working question Further information is requested

Comments

@MichaelMMeskhi
Copy link

MichaelMMeskhi commented Jan 10, 2025

[x] I checked the documentation and related resources and couldn't find an answer to my question.

Your Question
Running the example code for LLM based metric, I run into issues with await. Not sure if this is a bug or not. Running a non-async version works fine.

Code Examples

metric = AspectCritic(
    name="summary_accuracy",
    llm=evaluator_llm,
    definition="Verify if the summary is accurate.",
)
test_data = SingleTurnSample(**test_data)
await metric.single_turn_score(test_data) <--- SyntaxError: 'await' outside function
metric.single_turnscore(test_data)            <--- This works fine
@MichaelMMeskhi MichaelMMeskhi added the question Further information is requested label Jan 10, 2025
@dosubot dosubot bot added the bug Something isn't working label Jan 10, 2025
@IqraSiddiqui
Copy link

Since await is being used, it is important that you use this in an asynchronous context. try
score = await metric.single_turn_score(test_data)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants