From 9c3e598c8292e3d58da117ebcd64356d7c0df969 Mon Sep 17 00:00:00 2001 From: Sai Sanjay <97831658+sanjay7178@users.noreply.github.com> Date: Fri, 11 Oct 2024 08:07:23 +0000 Subject: [PATCH 1/2] Update Dockerfile and setup.sh to use uv for pip installation --- application/Dockerfile | 7 ++++--- pyproject.toml | 7 +++++++ setup.sh | 7 ++++--- uv.lock | 7 +++++++ 4 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 pyproject.toml create mode 100644 uv.lock diff --git a/application/Dockerfile b/application/Dockerfile index d076bc415..d493228c5 100644 --- a/application/Dockerfile +++ b/application/Dockerfile @@ -39,9 +39,10 @@ RUN python3.11 -m venv /venv ENV PATH="/venv/bin:$PATH" # Install Python packages -RUN pip install --no-cache-dir --upgrade pip && \ - pip install --no-cache-dir tiktoken && \ - pip install --no-cache-dir -r requirements.txt +RUN pip install uv && \ + uv pip install --no-cache-dir --upgrade pip && \ + uv pip install --no-cache-dir tiktoken && \ + uv pip install --no-cache-dir -r requirements.txt # Final Stage FROM ubuntu:24.04 as final diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..4ba205784 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,7 @@ +[project] +name = "DocsGPT" +version = "0.1.0" +description = "Chatbot for documentation, that allows you to chat with your data. Privately deployable, provides AI knowledge sharing and integrates knowledge into your AI workflow" + +[tool.uv] +requirements = "application/requirements.txt" diff --git a/setup.sh b/setup.sh index 988841da4..e9bbde023 100755 --- a/setup.sh +++ b/setup.sh @@ -33,9 +33,10 @@ download_locally() { docker-compose -f docker-compose-local.yaml build && docker-compose -f docker-compose-local.yaml up -d #python -m venv venv #source venv/bin/activate - pip install -r application/requirements.txt - pip install llama-cpp-python - pip install sentence-transformers + curl -LsSf https://astral.sh/uv/0.4.6/install.sh | sh + uv pip install -r application/requirements.txt + uv pip install llama-cpp-python + uv pip install sentence-transformers export LLM_NAME=llama.cpp export EMBEDDINGS_NAME=huggingface_sentence-transformers/all-mpnet-base-v2 export FLASK_APP=application/app.py diff --git a/uv.lock b/uv.lock new file mode 100644 index 000000000..ddfa3677f --- /dev/null +++ b/uv.lock @@ -0,0 +1,7 @@ +version = 1 +requires-python = ">=3.12" + +[[package]] +name = "docsgpt" +version = "0.1.0" +source = { virtual = "." } From d2fc3f2843fbe4ab7ed4db83250f1796297f829d Mon Sep 17 00:00:00 2001 From: Sai Sanjay <97831658+sanjay7178@users.noreply.github.com> Date: Fri, 11 Oct 2024 08:20:34 +0000 Subject: [PATCH 2/2] Remove pyproject.toml file --- pyproject.toml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4ba205784..e69de29bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +0,0 @@ -[project] -name = "DocsGPT" -version = "0.1.0" -description = "Chatbot for documentation, that allows you to chat with your data. Privately deployable, provides AI knowledge sharing and integrates knowledge into your AI workflow" - -[tool.uv] -requirements = "application/requirements.txt"