From c0c7acfe60297fbd966ec328d63fd0bb48236b4f Mon Sep 17 00:00:00 2001 From: kvan7 Date: Mon, 22 Jan 2024 03:24:31 +0000 Subject: [PATCH] upgrades upgrades --- Dockerfile | 19 ++++++++++++++++--- searx/plugins/chat.py | 5 +++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index d278fea6c..99c8c2636 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,18 @@ -FROM debian:bullseye-slim -ENTRYPOINT ["/sbin/tini","--","/usr/local/searxng/dockerfiles/docker-entrypoint.sh"] +FROM debian:latest +RUN apt-get update && apt-get install -y gcc make git \ + && git clone https://github.com/ncopa/su-exec.git /tmp/su-exec \ + && cd /tmp/su-exec \ + && make \ + && cp su-exec /usr/local/bin \ + && cd / \ + && rm -rf /tmp/su-exec \ + && apt-get purge -y --auto-remove gcc make git + +# RUN echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list \ +# && apt-get update \ +# && apt-get install -t bullseye-backports -y libstdc++6 + +ENTRYPOINT ["/usr/bin/tini","--","/usr/local/searxng/dockerfiles/docker-entrypoint.sh"] EXPOSE 8080 VOLUME /etc/searxng @@ -77,7 +90,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from requirements.txt COPY requirements.txt ./requirements.txt -RUN pip3 install --no-cache -r requirements.txt +RUN pip3 install --no-cache --break-system-packages -r requirements.txt COPY --chown=searxng:searxng dockerfiles ./dockerfiles diff --git a/searx/plugins/chat.py b/searx/plugins/chat.py index 1ac37475f..7a796f56d 100644 --- a/searx/plugins/chat.py +++ b/searx/plugins/chat.py @@ -1,7 +1,7 @@ from searx.search import SearchWithPlugins from pathlib import Path from gpt4all import GPT4All - +import os name = "Chat Plugin" description = "[REQUIRES ENGINE TOKEN] Similar to bing GPT or google bard in their respective searches" @@ -17,8 +17,9 @@ def post_search(request, search: SearchWithPlugins) -> None: container.chat_box['content'] = 'Generating response to query:
' + f'\n{search_request.query}' container.chat_box['code'] = 202 def generate_chat_content(query): + script_directory = Path(os.path.dirname(__file__)) model = GPT4All(model_name='gpt4all-falcon-q4_0.gguf', - model_path=(Path.cwd() / 'searx' / 'plugins'), + model_path=script_directory, allow_download=False) system_template = """