Merge branch 'main' of gitlab.prodcontest.com:team-39/backend

This commit is contained in:
gitgernit
2025-11-23 12:19:27 +03:00
3 changed files with 4 additions and 0 deletions
+1
View File
@@ -266,6 +266,7 @@ test:
COMPOSE_PROFILES: | COMPOSE_PROFILES: |
--profile migrations --profile migrations
--profile tests --profile tests
--profile ml
script: script:
- apk add --no-cache docker-compose - apk add --no-cache docker-compose
- export PROFILES="$(printf '%s ' $COMPOSE_PROFILES)" - export PROFILES="$(printf '%s ' $COMPOSE_PROFILES)"
+1
View File
@@ -29,6 +29,7 @@ backend = [
] ]
ml = [ ml = [
"sentence-transformers>=5.1.2", "sentence-transformers>=5.1.2",
"prometheus-fastapi-instrumentator>=7.1.0",
"torch", "torch",
] ]
types = [ types = [
+2
View File
@@ -13,6 +13,7 @@ from dishka import AsyncContainer
from dishka.integrations.fastapi import setup_dishka from dishka.integrations.fastapi import setup_dishka
from fastapi import FastAPI from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware from fastapi.middleware.cors import CORSMiddleware
from prometheus_fastapi_instrumentator import Instrumentator
from sentence_transformers import SentenceTransformer from sentence_transformers import SentenceTransformer
from template_project.ml.configuration import load_configuration from template_project.ml.configuration import load_configuration
@@ -68,6 +69,7 @@ def make_asgi_application(
app.include_router(healthcheck.router) app.include_router(healthcheck.router)
app.include_router(embed.router) app.include_router(embed.router)
app.include_router(predict.router) app.include_router(predict.router)
Instrumentator().instrument(app).expose(app)
setup_dishka(container=ioc, app=app) setup_dishka(container=ioc, app=app)