Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
596 changes: 117 additions & 479 deletions backend/poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ classifiers = [
"Framework :: Jupyter",
]

dependencies = ["pydantic", "langchain>=0.3.8", "unitxt>=1.26.6"]
dependencies = ["pydantic", "unitxt>=1.26.6"]

[tool.poetry]
packages = [{ include = "evalassist", from = "src" }]
Expand Down
87 changes: 4 additions & 83 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,122 +1,43 @@
aiohappyeyeballs==2.6.1 ; python_version >= "3.10" and python_version < "3.14"
aiohttp==3.12.13 ; python_version >= "3.10" and python_version < "3.14"
aiosignal==1.3.2 ; python_version >= "3.10" and python_version < "3.14"
alembic==1.16.2 ; python_version >= "3.10" and python_version < "3.14"
annotated-types==0.7.0 ; python_version >= "3.10" and python_version < "3.14"
anyio==4.9.0 ; python_version >= "3.10" and python_version < "3.14"
async-timeout==4.0.3 ; python_version == "3.10"
attrs==25.3.0 ; python_version >= "3.10" and python_version < "3.14"
beautifulsoup4==4.13.4 ; python_version >= "3.10" and python_version < "3.14"
bleach==6.2.0 ; python_version >= "3.10" and python_version < "3.14"
boto3==1.38.41 ; python_version >= "3.10" and python_version < "3.14"
botocore==1.38.41 ; python_version >= "3.10" and python_version < "3.14"
certifi==2025.6.15 ; python_version >= "3.10" and python_version < "3.14"
cffi==1.17.1 ; python_version >= "3.10" and python_version < "3.14" and (platform_python_implementation == "PyPy" or implementation_name == "pypy")
charset-normalizer==3.4.2 ; python_version >= "3.10" and python_version < "3.14"
click==8.2.1 ; python_version >= "3.10" and python_version < "3.14"
colorama==0.4.6 ; python_version >= "3.10" and python_version < "3.14" and platform_system == "Windows"
colorama==0.4.6 ; python_version >= "3.10" and python_version < "3.14"
datasets==3.6.0 ; python_version >= "3.10" and python_version < "3.14"
defusedxml==0.7.1 ; python_version >= "3.10" and python_version < "3.14"
dill==0.3.8 ; python_version >= "3.10" and python_version < "3.14"
diskcache==5.6.3 ; python_version >= "3.10" and python_version < "3.14"
distro==1.9.0 ; python_version >= "3.10" and python_version < "3.14"
evaluate==0.4.4 ; python_version >= "3.10" and python_version < "3.14"
exceptiongroup==1.3.0 ; python_version == "3.10"
fastapi==0.115.13 ; python_version >= "3.10" and python_version < "3.14"
fastjsonschema==2.21.1 ; python_version >= "3.10" and python_version < "3.14"
filelock==3.18.0 ; python_version >= "3.10" and python_version < "3.14"
frozenlist==1.7.0 ; python_version >= "3.10" and python_version < "3.14"
fsspec==2025.3.0 ; python_version >= "3.10" and python_version < "3.14"
greenlet==3.2.3 ; python_version >= "3.10" and python_version < "3.14" and (platform_machine == "aarch64" or platform_machine == "ppc64le" or platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64" or platform_machine == "win32" or platform_machine == "WIN32")
h11==0.16.0 ; python_version >= "3.10" and python_version < "3.14"
hf-xet==1.1.5 ; python_version >= "3.10" and python_version < "3.14" and (platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "arm64" or platform_machine == "aarch64")
httpcore==1.0.9 ; python_version >= "3.10" and python_version < "3.14"
httpx==0.28.1 ; python_version >= "3.10" and python_version < "3.14"
huggingface-hub==0.33.0 ; python_version >= "3.10" and python_version < "3.14"
ibm-cos-sdk-core==2.14.2 ; python_version >= "3.10" and python_version < "3.14"
ibm-cos-sdk-s3transfer==2.14.2 ; python_version >= "3.10" and python_version < "3.14"
ibm-cos-sdk==2.14.2 ; python_version >= "3.10" and python_version < "3.14"
ibm-watsonx-ai==1.3.26 ; python_version >= "3.10" and python_version < "3.14"
idna==3.10 ; python_version >= "3.10" and python_version < "3.14"
importlib-metadata==8.7.0 ; python_version >= "3.10" and python_version < "3.14"
jinja2==3.1.6 ; python_version >= "3.10" and python_version < "3.14"
jiter==0.10.0 ; python_version >= "3.10" and python_version < "3.14"
jmespath==1.0.1 ; python_version >= "3.10" and python_version < "3.14"
jsonpatch==1.33 ; python_version >= "3.10" and python_version < "3.14"
jsonpointer==3.0.0 ; python_version >= "3.10" and python_version < "3.14"
jsonschema-specifications==2025.4.1 ; python_version >= "3.10" and python_version < "3.14"
jsonschema==4.24.0 ; python_version >= "3.10" and python_version < "3.14"
jupyter-client==8.6.3 ; python_version >= "3.10" and python_version < "3.14"
jupyter-core==5.8.1 ; python_version >= "3.10" and python_version < "3.14"
jupyterlab-pygments==0.3.0 ; python_version >= "3.10" and python_version < "3.14"
langchain-core==0.3.66 ; python_version >= "3.10" and python_version < "3.14"
langchain-text-splitters==0.3.8 ; python_version >= "3.10" and python_version < "3.14"
langchain==0.3.26 ; python_version >= "3.10" and python_version < "3.14"
langsmith==0.4.1 ; python_version >= "3.10" and python_version < "3.14"
litellm==1.73.0 ; python_version >= "3.10" and python_version < "3.14"
lomond==0.3.3 ; python_version >= "3.10" and python_version < "3.14"
mako==1.3.10 ; python_version >= "3.10" and python_version < "3.14"
markupsafe==3.0.2 ; python_version >= "3.10" and python_version < "3.14"
mistune==3.1.3 ; python_version >= "3.10" and python_version < "3.14"
multidict==6.5.0 ; python_version >= "3.10" and python_version < "3.14"
multiprocess==0.70.16 ; python_version >= "3.10" and python_version < "3.14"
nbclient==0.10.2 ; python_version >= "3.10" and python_version < "3.14"
nbconvert==7.16.6 ; python_version >= "3.10" and python_version < "3.14"
nbformat==5.10.4 ; python_version >= "3.10" and python_version < "3.14"
nest-asyncio==1.6.0 ; python_version >= "3.10" and python_version < "3.14"
numpy==2.2.6 ; python_version == "3.10"
numpy==2.3.1 ; python_version >= "3.11" and python_version < "3.14"
ollama==0.5.1 ; python_version >= "3.10" and python_version < "3.14"
openai==1.90.0 ; python_version >= "3.10" and python_version < "3.14"
orjson==3.10.18 ; python_version >= "3.10" and python_version < "3.14" and platform_python_implementation != "PyPy"
numpy==2.2.6 ; python_version >= "3.10" and python_version < "3.12"
numpy==2.3.1 ; python_version >= "3.12" and python_version < "3.14"
packaging==24.2 ; python_version >= "3.10" and python_version < "3.14"
pandas==2.2.3 ; python_version >= "3.10" and python_version < "3.14"
pandocfilters==1.5.1 ; python_version >= "3.10" and python_version < "3.14"
platformdirs==4.3.8 ; python_version >= "3.10" and python_version < "3.14"
propcache==0.3.2 ; python_version >= "3.10" and python_version < "3.14"
pyarrow==20.0.0 ; python_version >= "3.10" and python_version < "3.14"
pycparser==2.22 ; python_version >= "3.10" and python_version < "3.14" and (platform_python_implementation == "PyPy" or implementation_name == "pypy")
pydantic-core==2.33.2 ; python_version >= "3.10" and python_version < "3.14"
pydantic==2.11.7 ; python_version >= "3.10" and python_version < "3.14"
pygments==2.19.2 ; python_version >= "3.10" and python_version < "3.14"
python-dateutil==2.9.0.post0 ; python_version >= "3.10" and python_version < "3.14"
python-dotenv==1.1.0 ; python_version >= "3.10" and python_version < "3.14"
pytz==2025.2 ; python_version >= "3.10" and python_version < "3.14"
pywin32==310 ; python_version >= "3.10" and python_version < "3.14" and platform_python_implementation != "PyPy" and sys_platform == "win32"
pyyaml==6.0.2 ; python_version >= "3.10" and python_version < "3.14"
pyzmq==27.0.0 ; python_version >= "3.10" and python_version < "3.14"
referencing==0.36.2 ; python_version >= "3.10" and python_version < "3.14"
regex==2024.11.6 ; python_version >= "3.10" and python_version < "3.14"
requests-toolbelt==1.0.0 ; python_version >= "3.10" and python_version < "3.14"
requests==2.32.4 ; python_version >= "3.10" and python_version < "3.14"
rpds-py==0.25.1 ; python_version >= "3.10" and python_version < "3.14"
s3transfer==0.13.0 ; python_version >= "3.10" and python_version < "3.14"
scipy==1.15.3 ; python_version == "3.10"
scipy==1.16.0 ; python_version >= "3.11" and python_version < "3.14"
setuptools==80.9.0 ; python_version >= "3.10" and python_version < "3.14"
six==1.17.0 ; python_version >= "3.10" and python_version < "3.14"
sniffio==1.3.1 ; python_version >= "3.10" and python_version < "3.14"
soupsieve==2.7 ; python_version >= "3.10" and python_version < "3.14"
sqlalchemy==2.0.41 ; python_version >= "3.10" and python_version < "3.14"
sqlmodel==0.0.24 ; python_version >= "3.10" and python_version < "3.14"
starlette==0.46.2 ; python_version >= "3.10" and python_version < "3.14"
tabulate==0.9.0 ; python_version >= "3.10" and python_version < "3.14"
tenacity==9.1.2 ; python_version >= "3.10" and python_version < "3.14"
tiktoken==0.9.0 ; python_version >= "3.10" and python_version < "3.14"
tinycss2==1.4.0 ; python_version >= "3.10" and python_version < "3.14"
tokenizers==0.21.1 ; python_version >= "3.10" and python_version < "3.14"
tomli==2.2.1 ; python_version == "3.10"
tornado==6.5.1 ; python_version >= "3.10" and python_version < "3.14"
tqdm==4.67.1 ; python_version >= "3.10" and python_version < "3.14"
traitlets==5.14.3 ; python_version >= "3.10" and python_version < "3.14"
typing-extensions==4.14.0 ; python_version >= "3.10" and python_version < "3.14"
typing-inspection==0.4.1 ; python_version >= "3.10" and python_version < "3.14"
tzdata==2025.2 ; python_version >= "3.10" and python_version < "3.14"
unitxt==1.24.0 ; python_version >= "3.10" and python_version < "3.14"
unitxt==1.26.6 ; python_version >= "3.10" and python_version < "3.14"
urllib3==2.5.0 ; python_version >= "3.10" and python_version < "3.14"
uvicorn==0.34.3 ; python_version >= "3.10" and python_version < "3.14"
webencodings==0.5.1 ; python_version >= "3.10" and python_version < "3.14"
xxhash==3.5.0 ; python_version >= "3.10" and python_version < "3.14"
yarl==1.20.1 ; python_version >= "3.10" and python_version < "3.14"
zipp==3.23.0 ; python_version >= "3.10" and python_version < "3.14"
zstandard==0.23.0 ; python_version >= "3.10" and python_version < "3.14"
5 changes: 0 additions & 5 deletions backend/src/evalassist/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import logging

import litellm

litellm.drop_params = True
litellm.disable_aiohttp_transport = True

root_pkg_logger = logging.getLogger(__name__)
root_pkg_logger.propagate = False

Expand Down
22 changes: 8 additions & 14 deletions backend/src/evalassist/judges/direct_judge.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
get_to_evaluate_text,
is_float,
)
from langchain_core.prompts.prompt import PromptTemplate
from pydantic import BaseModel, Field
from unitxt.inference import InferenceEngine

Expand Down Expand Up @@ -621,26 +620,21 @@ def validate_selected_score(cls, value: float) -> float:
"structured_output_model", field_defs
)

prompt_template = PromptTemplate(
input_variables=["judge_prompt"],
partial_variables={
"format_instructions": build_format_instructions(dynamic_model),
},
template=dedent(
text="""\
{judge_prompt}
prompt_template = dedent(
text="""\
{judge_prompt}

### Output format
{format_instructions}
### Output format
{format_instructions}

Only output the json instance, anything else will result in a failed generation.
""",
),
Only output the json instance, anything else will result in a failed generation.
""",
)

prompts: list[str] = [
prompt_template.format(
judge_prompt=judge_prompt,
format_instructions=build_format_instructions(dynamic_model),
)
for judge_prompt in judge_prompts
]
Expand Down
7 changes: 2 additions & 5 deletions backend/src/evalassist/judges/mprometheus_judge.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from typing import Literal, cast

from fastapi import HTTPException

from .base import BaseDirectJudge, BasePairwiseJudge
from .types import Criteria, DirectInstanceResult, Instance, PairwiseInstanceResult
from .utils import get_to_evaluate_text
Expand Down Expand Up @@ -53,9 +51,8 @@ def _run(
)
from prometheus_eval.vllm import VLLM
except ModuleNotFoundError:
raise HTTPException(
status_code=404,
detail="Failed to import 'prometheus_eval' package. Make sure it is installed correctly.",
raise ValueError(
"Failed to import 'prometheus_eval' package. Make sure it is installed correctly.",
)

self._validate_criteria(criteria)
Expand Down
Loading