diff --git a/main.py b/main.py index 859da49..3445756 100644 --- a/main.py +++ b/main.py @@ -14,9 +14,6 @@ logger = logging.getLogger(__name__) @asynccontextmanager async def lifespan(app: FastAPI): - await delete_tables() - logger.info("База данных очищена") - await create_tables() logger.info("База данных готова к работе") yield logger.info("Выключение") diff --git a/model.py b/model.py index 714f4eb..922b02f 100644 --- a/model.py +++ b/model.py @@ -1,7 +1,6 @@ import pickle import numpy as np import tensorflow as tf -from keras.src.legacy.preprocessing.text import Tokenizer from keras.src.utils import pad_sequences from enums import TypeMood, TypeModel diff --git a/repository.py b/repository.py index df09748..0d09d4b 100644 --- a/repository.py +++ b/repository.py @@ -42,7 +42,7 @@ class QuestionRepository: query = select(QuestionOrm).where(QuestionOrm.email_user == data.email_user) result = await session.execute(query) user_questions = result.scalars().all() - if len(user_questions) > 10: + if len(user_questions) > 100: # Удаление самой старой записи oldest_question = min(user_questions, key=lambda q: q.question_time) await session.delete(oldest_question) diff --git a/router_class.py b/router_class.py index 686d129..7a5b313 100644 --- a/router_class.py +++ b/router_class.py @@ -1,10 +1,6 @@ -import pandas as pd from fastapi import APIRouter from typing import List -from enums import TypeMood -from schemas import Review - router = APIRouter( prefix="/class", tags=["Class"],