From 4df15830f71e14b8a1caa9b95927e8f86ec7e8fc Mon Sep 17 00:00:00 2001 From: Gary H <26419401+Gary-H9@users.noreply.github.com> Date: Mon, 8 Jul 2024 11:39:14 +0000 Subject: [PATCH] Final touches --- README.md | 18 ++++++++++++++++-- ollamate/settings.py | 2 +- ollamate/urls.py | 12 ++++++------ scripts/devcontainer/post-create.sh | 2 +- .../templates/streamingapp/input_form.html | 11 ++--------- streamingapp/views.py | 2 +- 6 files changed, 27 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 9eb1f26..d5ecdc9 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,21 @@ This repository includes a Django application which presents a simple frontend t The name 'Ollamate' is derived from Ollama and will be changed if/when this application evolves. -## Getting Started - > [!NOTE] > 🚧 WIP 🚧 + + +## Running Locally + +Ollamate is run in a Development Container via Docker. The Development Container VSCode [extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) is recommended. Additionally ensure [Docker Desktop](https://www.docker.com/products/docker-desktop/) is running. + +For more information on Dev Containers, see the [Analytical Platform docs.](https://technical-documentation.data-platform.service.justice.gov.uk/documentation/platform/infrastructure/developing.html#developing-the-data-platform) + + +### Building the Development Container +Open this repository in Visual Studio Code. Open the Command Palette `Command + Shift + p`, search for and select ```> Dev Containers: Reopen in container```. + +The Development Container utilises Docker in Docker to create two containers - `ollama` and `postgresql`. This allows for easy setup when working on Ollamate locally. + +### Environment Variables +There is an example `.env.example` file. Paste the contents into a new file called ```.env``` in the root of the project. diff --git a/ollamate/settings.py b/ollamate/settings.py index c12f2f4..3c8d461 100644 --- a/ollamate/settings.py +++ b/ollamate/settings.py @@ -61,7 +61,7 @@ "django.contrib.messages", "django.contrib.staticfiles", "streamingapp", - "azure_auth", + # "azure_auth" ] MIDDLEWARE = [ diff --git a/ollamate/urls.py b/ollamate/urls.py index e0e3e65..935ac14 100644 --- a/ollamate/urls.py +++ b/ollamate/urls.py @@ -1,14 +1,14 @@ from django.contrib import admin from django.urls import include, path -from streamingapp.views import redirect_to_ollama +# from streamingapp.views import redirect_to_ollama urlpatterns = [ path("admin/", admin.site.urls), - path( - "azure_auth/", - include("azure_auth.urls"), - ), + # path( + # "azure_auth/", + # include("azure_auth.urls"), + # ), path("stream/", include("streamingapp.urls")), - path("", redirect_to_ollama), + # path("", redirect_to_ollama), ] diff --git a/scripts/devcontainer/post-create.sh b/scripts/devcontainer/post-create.sh index 83631b5..4f6a06f 100644 --- a/scripts/devcontainer/post-create.sh +++ b/scripts/devcontainer/post-create.sh @@ -10,7 +10,7 @@ docker compose --file contrib/docker-compose-postgres.yml up --detach docker compose --file contrib/docker-compose-ollama.yml up --detach # Start Ollama Model -docker exec -it contrib-ollama-1 ollama run orca-mini +docker exec -it contrib-ollama-1 ollama run orca-mini & # Upgrade Pip pip install --break-system-package --upgrade pip diff --git a/streamingapp/templates/streamingapp/input_form.html b/streamingapp/templates/streamingapp/input_form.html index 76409ca..19f93ad 100644 --- a/streamingapp/templates/streamingapp/input_form.html +++ b/streamingapp/templates/streamingapp/input_form.html @@ -46,13 +46,6 @@
Logged in as: {{ user.username }}
-Enter text below to interact with Ollamate: