Files
AiDA_Python/README.md
zcr 18024a2d70
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
feat : 代码梳理 移除所有敏感密钥 通过环境变量方式配置
2025-12-30 16:49:08 +08:00

45 lines
1.1 KiB
Markdown

文件解释
-----------
样例包括:
* README.md - 本文件
* Dockerfile - 用以自动构建 Docker 镜像的脚本
* requirements.txt - 依赖包文件
* main.py - 主 fastapis 服务器端源代码
* python-version : 3.9
快速开始
---------------
如下这些引导,假定你想在自己的电脑上开发本项目。
1. 安装依赖
$ conda create -n trinity_client_aida python=3.9 -y
$ conda activate trinity_client_aida
$ pip install -r requirements.txt
$ conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia -y
$ pip install mmcv==1.4.2 -f https://download.openmmlab.com/mmcv/dist/cu117/torch1.13/index.html
1. 启动服务器
$ uvicorn app.main:app --host 0.0.0.0 --port 8000
2. 打开 http://127.0.0.1:8000/docs
Docker 部署
---------------
1. 构建镜像
$ cd {workspace}
$ docker build -t trinity_client_mixi
2. 使用docker-compose 启动
$ docker-compose up -d
3. 查看日志
$ docker-compose logs -f