TakwayPlatform/README.md

85 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# TakwayAI后端
### 项目架构
AI后端使用fastapi框架采用分层架构
```
TakwayAI/
├── app/
│ ├── __init__.py # 应用初始化和配置
│ ├── main.py # 应用启动入口
│ ├── models/ # 数据模型定义
│ │ ├── __init__.py
│ │ ├── models.py # 数据库定义
│ ├── schemas/ # 请求和响应模型
│ │ ├── __init__.py
│ │ ├── user.py # 用户相关schema
│ │ └── ... # 其他schema
│ ├── controllers/ # 业务逻辑控制器
│ │ ├── __init__.py
│ │ ├── user.py # 用户相关控制器
│ │ └── ... # 其他控制器
│ ├── routes/ # 路由和视图函数
│ │ ├── __init__.py
│ │ ├── user.py # 用户相关路由
│ │ └── ... # 其他路由
│ ├── dependencies/ # 依赖注入相关
│ │ ├── __init__.py
│ │ ├── database.py # 数据库依赖
│ │ └── ... # 其他依赖
│ └── exceptions/ # 自定义异常处理
│ ├── __init__.py
│ └── ... # 自定义异常类
├── tests/ # 测试代码
│ ├── __init__.py
| └── ...
├── config/ # 配置文件
│ ├── __init__.py
│ ├── production.py # 生产环境配置
│ ├── development.py # 开发环境配置
│ └── ... # 其他环境配置
├── utils/ # 工具函数和辅助类
│ ├── __init__.py
│ ├── stt # 语音转文本工具函数
│ ├── tts # 语音合成工具函数
│ └── ... # 其他工具函数
|
├── main.py #启动脚本
├── app.log # 日志文件
├── Dockerfile # 用于构建Docker镜像的Dockerfile
├── requirements.txt # 项目依赖列表
└── README.md # 项目说明文件
```
### 项目部署
#### (1) 将项目clone到本地:
``` shell
git clone http://43.132.157.186:3000/killua/TakwayPlatform.git
```
#### (2) 安装依赖
``` shell
cd TakwayAI/
pip install -r requirements.txt
```
#### (3) 修改配置
1. 安装mysql在mysql中创建名为takway的数据库
2. 安装redis将密码设置为takway
3. 打开config中的development.py文件修改mysql和redis连接字符串
#### (4) 导入vits模型
在utils/tts/目录下创建vits_model文件夹
从[链接](https://huggingface.co/spaces/zomehwh/vits-uma-genshin-honkai/tree/main/model)下载 vits_model并放入该文件夹下只需下载config.json和G_953000.pth即可