update: 将app启动位置至根目录下
This commit is contained in:
parent
88bcfd03a6
commit
0593bf0482
|
@ -8,4 +8,7 @@ app.log
|
|||
/utils/tts/vits_model/
|
||||
vits_model
|
||||
|
||||
nohup.out
|
||||
nohup.out
|
||||
|
||||
/app/takway-ai.top.key
|
||||
/app/takway-ai.top.pem
|
26
app/main.py
26
app/main.py
|
@ -1,26 +0,0 @@
|
|||
from app import app, Config
|
||||
import uvicorn
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
uvicorn.run(app, host=Config.UVICORN.HOST, port=Config.UVICORN.PORT)
|
||||
#uvicorn.run("app.main:app", host=Config.UVICORN.HOST, port=Config.UVICORN.PORT, workers=Config.UVICORN.WORKERS)
|
||||
# _ooOoo_ #
|
||||
# o8888888o #
|
||||
# 88" . "88 #
|
||||
# (| -_- |) #
|
||||
# O\ = /O #
|
||||
# ____/`---'\____ #
|
||||
# . ' \\| |// `. #
|
||||
# / \\||| : |||// \ #
|
||||
# / _||||| -:- |||||- \ #
|
||||
# | | \\\ - /// | | #
|
||||
# \ .-\__ `-` ___/-. / #
|
||||
# ___`. .' /--.--\ `. . __ #
|
||||
# ."" '< `.___\_<|>_/___.' >'"". #
|
||||
# | | : `- \`.;`\ _ /`;.`/ - ` : | | #
|
||||
# \ \ `-. \_ __\ /__ _/ .-` / / #
|
||||
# ======`-.____`-.___\_____/___.-`____.-'====== #
|
||||
# `=---=' #
|
||||
# ............................................. #
|
||||
# 佛祖保佑 永无BUG #
|
31
main.py
31
main.py
|
@ -1,9 +1,24 @@
|
|||
import os
|
||||
from app import app, Config
|
||||
import uvicorn
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
script_path = os.path.join(os.path.dirname(__file__), 'app', 'main.py')
|
||||
|
||||
# 使用exec函数执行脚本
|
||||
with open(script_path, 'r') as file:
|
||||
exec(file.read())
|
||||
if __name__ == "__main__":
|
||||
uvicorn.run(app, host=Config.UVICORN.HOST, port=Config.UVICORN.PORT)
|
||||
# _ooOoo_ #
|
||||
# o8888888o #
|
||||
# 88" . "88 #
|
||||
# (| -_- |) #
|
||||
# O\ = /O #
|
||||
# ____/`---'\____ #
|
||||
# . ' \\| |// `. #
|
||||
# / \\||| : |||// \ #
|
||||
# / _||||| -:- |||||- \ #
|
||||
# | | \\\ - /// | | #
|
||||
# \ .-\__ `-` ___/-. / #
|
||||
# ___`. .' /--.--\ `. . __ #
|
||||
# ."" '< `.___\_<|>_/___.' >'"". #
|
||||
# | | : `- \`.;`\ _ /`;.`/ - ` : | | #
|
||||
# \ \ `-. \_ __\ /__ _/ .-` / / #
|
||||
# ======`-.____`-.___\_____/___.-`____.-'====== #
|
||||
# `=---=' #
|
||||
# ............................................. #
|
||||
# 佛祖保佑 永无BUG #
|
Loading…
Reference in New Issue