From e405ccb8f38c6033cce17119047cc77ae84a8eac Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Fri, 27 Oct 2023 20:08:00 +0200 Subject: [PATCH] server: started updating documentation --- README.md | 11 +++++++++-- docker-compose.yml | 14 +++++++++++--- server/docker-compose.yml | 28 ++++++++++++++++++---------- server/runserver.sh | 9 ++++++++- 4 files changed, 46 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 22651cc6..150c4575 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ The project architecture consists of three primary components: * **Front-End**: NextJS React project hosted on Vercel, located in `www/`. * **Back-End**: Python server that offers an API and data persistence, found in `server/`. -* **AI Models**: Providing services such as speech-to-text transcription, topic generation, automated summaries, and translations. +* **GPU implementation**: Providing services such as speech-to-text transcription, topic generation, automated summaries, and translations. It also uses https://github.com/fief-dev for authentication, and Vercel for deployment and configuration of the front-end. @@ -120,6 +120,9 @@ TRANSCRIPT_MODAL_API_KEY= LLM_BACKEND=modal LLM_URL=https://monadical-sas--reflector-llm-web.modal.run LLM_MODAL_API_KEY= +TRANSLATE_URL=https://monadical-sas--reflector-translator-web.modal.run +ZEPHYR_LLM_URL=https://monadical-sas--reflector-llm-zephyr-web.modal.run +DIARIZATION_URL=https://monadical-sas--reflector-diarizer-web.modal.run AUTH_BACKEND=fief AUTH_FIEF_URL=https://auth.reflector.media/reflector-local @@ -138,6 +141,10 @@ Use: poetry run python3 -m reflector.app ``` +And start the background worker + +celery -A reflector.worker.app worker --loglevel=info + #### Using docker Use: @@ -161,4 +168,4 @@ poetry run python -m reflector.tools.process path/to/audio.wav ## AI Models -*(Documentation for this section is pending.)* \ No newline at end of file +*(Documentation for this section is pending.)* diff --git a/docker-compose.yml b/docker-compose.yml index 934baaac..9e6519af 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,10 +5,19 @@ services: context: server ports: - 1250:1250 - environment: - LLM_URL: "${LLM_URL}" volumes: - model-cache:/root/.cache + environment: ENTRYPOINT=server + worker: + build: + context: server + volumes: + - model-cache:/root/.cache + environment: ENTRYPOINT=worker + redis: + image: redis:7.2 + ports: + - 6379:6379 web: build: context: www @@ -17,4 +26,3 @@ services: volumes: model-cache: - diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 4e5a21e8..c8432816 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -1,15 +1,23 @@ version: "3.9" services: - # server: - # build: - # context: . - # ports: - # - 1250:1250 - # environment: - # LLM_URL: "${LLM_URL}" - # MIN_TRANSCRIPT_LENGTH: "${MIN_TRANSCRIPT_LENGTH}" - # volumes: - # - model-cache:/root/.cache + server: + build: + context: . + ports: + - 1250:1250 + volumes: + - model-cache:/root/.cache + environment: + ENTRYPOINT: server + REDIS_HOST: redis + worker: + build: + context: . + volumes: + - model-cache:/root/.cache + environment: + ENTRYPOINT: worker + REDIS_HOST: redis redis: image: redis:7.2 ports: diff --git a/server/runserver.sh b/server/runserver.sh index 38eafe09..b0c3f138 100755 --- a/server/runserver.sh +++ b/server/runserver.sh @@ -4,4 +4,11 @@ if [ -f "/venv/bin/activate" ]; then source /venv/bin/activate fi alembic upgrade head -python -m reflector.app + +if [ "${ENTRYPOINT}" = "server" ]; then + python -m reflector.app +elif [ "${ENTRYPOINT}" = "worker" ]; then + celery -A reflector.worker.app worker --loglevel=info +else + echo "Unknown command" +fi