Skip to content

Commit

Permalink
chore: fix dependency & bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Lanture1064 committed Mar 8, 2024
1 parent d88f6ef commit 0bd4ed6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN apt-get install -y gcc python3-dev
# Official: https://pypi.org/simple
ARG PYTHON_INDEX_URL=https://pypi.mirrors.ustc.edu.cn/simple/
COPY libs /libs
RUN python -m pip install ragas langchain sentencepiece -i ${PYTHON_INDEX_URL}
RUN python -m pip install ragas langchain sentencepiece protobuf -i ${PYTHON_INDEX_URL}
WORKDIR /libs/core
RUN pip install -e . -i ${PYTHON_INDEX_URL}

Expand Down
12 changes: 7 additions & 5 deletions libs/core/kubeagi_core/evaluation/ragas_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from ragas import evaluate
from ragas.embeddings import BaseRagasEmbeddings
from ragas.llms import BaseRagasLLM
from ragas.llms import BaseRagasLLM, LangchainLLMWrapper
from ragas.metrics import (
AnswerCorrectness,
AnswerRelevancy,
Expand Down Expand Up @@ -87,10 +87,12 @@ def __init__(
)

# Initialize judge llm
self.llm = ChatOpenAI(
model_name=self.llm_model,
openai_api_key=self.api_key,
openai_api_base=self.api_base,
self.llm = LangchainLLMWrapper(
langchain_llm=ChatOpenAI(
name=self.llm_model,
api_key=self.api_key,
base_url=self.api_base,
)
)

# Initialize judge embedding
Expand Down
4 changes: 2 additions & 2 deletions libs/core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ classifiers = [
dependencies = [
"docx2txt==0.8",
"kubernetes==25.3.0",
"langchain==0.1.0",
"ragas==0.0.22",
"langchain>=0.1.0",
"ragas>=0.1.0",
"spacy==3.5.4",
"zhipuai==1.0.7",
]
Expand Down

0 comments on commit 0bd4ed6

Please sign in to comment.