Skip to content

Commit

Permalink
lint and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
tcapelle committed Feb 5, 2025
1 parent 919d0f3 commit d06c636
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion tests/scorers/test_llm_integrations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

import pytest

from weave.scorers.summarization_scorer import (
Expand Down Expand Up @@ -26,13 +27,14 @@
},
}


@pytest.fixture(
params=[
(provider, model)
for provider, cfg in PROVIDERS.items()
for model in cfg["models"]
],
ids=lambda p: f"{p[0]}:{p[1]}"
ids=lambda p: f"{p[0]}:{p[1]}",
)
def summarization_scorer(request):
"""
Expand All @@ -49,6 +51,7 @@ def summarization_scorer(request):
max_tokens=1024,
)


@pytest.mark.asyncio
async def test_summarization_scorer_evaluate_summary(summarization_scorer):
input_text = "The wolf is lonely in the forest. He is not happy that the fox is not with him."
Expand Down
4 changes: 2 additions & 2 deletions weave/scorers/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ def check_litellm_installation():
"""Check if litellm is installed and raise an informative error if not."""
try:
from litellm import acompletion # noqa: F401

return acompletion
except ImportError:
raise ImportError(
"litellm is required to use the LLM-powered scorers, please install it with `pip install litellm`"
)
else:
return True

0 comments on commit d06c636

Please sign in to comment.