2024-08-30 11:01:07 +08:00
2024-08-30 11:01:07 +08:00
2024-04-03 15:00:17 +08:00
2024-04-03 14:46:36 +08:00
2024-03-28 10:30:18 +08:00
2024-03-28 10:30:18 +08:00
2024-03-28 10:30:18 +08:00
2024-03-28 10:30:18 +08:00
2024-04-03 15:36:09 +08:00

文件解释

样例包括:

  • README.md - 本文件
  • Dockerfile - 用以自动构建 Docker 镜像的脚本
  • requirements.txt - 依赖包文件
  • main.py - 主 Flask 服务器端源代码
  • python-version : 3.9

快速开始

如下这些引导,假定你想在自己的电脑上开发本项目。

  1. 安装依赖

      $ conda create -n trinity_client_mixi python=3.9  -y
      $ conda activate trinity_client_mixi 
      $ 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
    
  2. 启动服务器

     $ uvicorn app.main:app --host 0.0.0.0 --port 8000
    
  3. 打开 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 
    
Description
No description provided
Readme 350 KiB
Languages
Python 99.2%
Dockerfile 0.8%