From 78c779b9055b02be1ff49337a3a39c293a3ba21f Mon Sep 17 00:00:00 2001 From: Ryuichi Takano <45957617+tknrych@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:59:41 +0900 Subject: [PATCH 1/3] Update user-management.md Updated the description according to the latest kotaemon version. --- docs/pages/app/ext/user-management.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/app/ext/user-management.md b/docs/pages/app/ext/user-management.md index 988380f2..1b3979ee 100644 --- a/docs/pages/app/ext/user-management.md +++ b/docs/pages/app/ext/user-management.md @@ -11,4 +11,4 @@ Once enabled, you have access to the following features: - User login/logout (located in Settings Tab) - User changing password (located in Settings Tab) -- Create / List / Edit / Delete user (located in Admin > User Management Tab) +- Create / List / Edit / Delete user (located in Resources > Users Tab) From 1be2c0db9e3af496afad4de94a27e0076047f56a Mon Sep 17 00:00:00 2001 From: Ryuichi Takano Date: Wed, 27 Nov 2024 13:46:42 +0900 Subject: [PATCH 2/3] fix: reranking process when TeiFastReranking is specified. --- .gitignore | 4 ++++ Dockerfile | 6 +++++- libs/kotaemon/kotaemon/rerankings/tei_fast_rerank.py | 7 ++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 80e557d1..e9177b38 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,10 @@ activate* activate/* kotaemon-env* .env +workdir* +workdir/* +run_container_ricoh.sh +Makefile ### Emacs ### # -*- mode: gitignore; -*- diff --git a/Dockerfile b/Dockerfile index 0ea07124..e1cfba3e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,12 +37,16 @@ RUN bash scripts/download_pdfjs.sh $PDFJS_PREBUILT_DIR COPY . /app COPY .env.example /app/.env +# Update pip command +RUN pip install --upgrade pip + # Install pip packages RUN --mount=type=ssh \ --mount=type=cache,target=/root/.cache/pip \ pip install -e "libs/kotaemon" \ && pip install -e "libs/ktem" \ - && pip install "pdfservices-sdk@git+https://github.com/niallcm/pdfservices-python-sdk.git@bump-and-unfreeze-requirements" + && pip install "pdfservices-sdk@git+https://github.com/niallcm/pdfservices-python-sdk.git@bump-and-unfreeze-requirements" \ + && pip install "docling" RUN --mount=type=ssh \ --mount=type=cache,target=/root/.cache/pip \ diff --git a/libs/kotaemon/kotaemon/rerankings/tei_fast_rerank.py b/libs/kotaemon/kotaemon/rerankings/tei_fast_rerank.py index 4ac4b8ef..3cb81f63 100644 --- a/libs/kotaemon/kotaemon/rerankings/tei_fast_rerank.py +++ b/libs/kotaemon/kotaemon/rerankings/tei_fast_rerank.py @@ -29,13 +29,18 @@ class TeiFastReranking(BaseReranking): ), ) is_truncated: Optional[bool] = Param(True, help="Whether to truncate the inputs") + max_tokens: Optional[int] = Param(512, help="This option is used to specify the maximum number of tokens supported by the reranker model.") def client(self, query, texts): + if self.is_truncated == True: + max_tokens = self.max_tokens # default is 512 tokens. + truncated_texts = [text[:max_tokens] for text in texts] + response = session.post( url=self.endpoint_url, json={ "query": query, - "texts": texts, + "texts": truncated_texts, "is_truncated": self.is_truncated, # default is True }, ).json() From ce3cefbbfae16c71f96ef47d9132c3c671daa14d Mon Sep 17 00:00:00 2001 From: Ryuichi Takano Date: Wed, 27 Nov 2024 14:22:35 +0900 Subject: [PATCH 3/3] fix: github commit issue. Please ignore. --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e9177b38..a568934e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,9 @@ kotaemon-env* .env workdir* workdir/* -run_container_ricoh.sh +run_container.sh Makefile +Dockerfile ### Emacs ### # -*- mode: gitignore; -*-