完成训练模块的转移

This commit is contained in:
2025-04-17 11:03:05 +08:00
parent 4439687870
commit 74e8f0d415
188 changed files with 32931 additions and 70 deletions

View File

@ -6,7 +6,7 @@
# @IDE : PyCharm
# @desc : 全局事件
import torch
from fastapi import FastAPI
from motor.motor_asyncio import AsyncIOMotorClient
from application.settings import REDIS_DB_URL, MONGO_DB_URL, MONGO_DB_NAME, EVENTS
@ -68,6 +68,9 @@ async def connect_redis(app: FastAPI, status: bool):
response = await rd.ping()
if response:
print("Redis 连接成功")
# 数据初始化
is_gpu = torch.cuda.is_available()
rd.set('is_gpu', str(is_gpu))
else:
print("Redis 连接失败")
except AuthenticationError as e: