Какие то правочки, туда сюда
This commit is contained in:
parent
3ff4df7386
commit
ba13e38690
3
main.py
3
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("Выключение")
|
||||
|
1
model.py
1
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
|
||||
|
@ -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)
|
||||
|
@ -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"],
|
||||
|
Loading…
Reference in New Issue
Block a user