From a652e545d8dc0a61848653f63a5dc0350c21c658 Mon Sep 17 00:00:00 2001 From: Ondrej Platek Date: Mon, 11 Nov 2024 11:08:51 +0100 Subject: [PATCH] fix factgenie launch; add ollama service to docker-compose --- Dockerfile | 2 +- docker-compose.yml | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7379c4bb..252c4d8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,4 +9,4 @@ RUN cp /usr/src/factgenie/factgenie/config/config_TEMPLATE.yml /usr/src/factgeni RUN pip install -e .[deploy] EXPOSE 80 -ENTRYPOINT ["gunicorn", "--env", "SCRIPT_NAME=", "-b", ":80", "-w", "1", "--threads", "8", "factgenie.cli:create_app()"] +ENTRYPOINT ["gunicorn", "--env", "SCRIPT_NAME=", "-b", ":80", "-w", "1", "--threads", "8", "factgenie.bin.run:create_app()"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index bf739227..dbe25558 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,7 @@ +# YOU NEED run once `curl http://localhost:11434/api/pull -d '{"name": "llama3.1:8b"}'` +# after running `docker-compose up -d` from the repo root directory +# in order to download the llama3.1:8b model which is the default model +# we use in the example configurations for factgenie services: factgenie: container_name: factgenie @@ -5,4 +9,21 @@ services: restart: on-failure ports: - 8890:80 - build: ./factgenie + build: ./ + + # Factgenie connects to LLM inference servers either OpenAI client or Ollama + # Demonstrates running ollama on CPU + # For GPU run ollama without Docker + # or look at https://hub.docker.com/r/ollama/ollama and follow the GPU instructions + ollama: + container_name: ollama + image: ollama/ollama + restart: on-failure + # We need to expose the port to your machine because you need to pull models for ollama + # before factgenie queries the ollama server to run inference for the model. + # E.g. curl http://localhost:11434/api/pull -d '{"name": "llama3.1:8b"}' to download the factgenie default LLM. + ports: + - 11434:11434 + + +