From 46b3b285f5f66b928908c32f63a633821ce6021b Mon Sep 17 00:00:00 2001 From: josc146 Date: Wed, 25 Oct 2023 17:07:40 +0800 Subject: [PATCH] upgrade packages --- .github/workflows/release.yml | 4 ++-- backend-python/dep_check.py | 2 ++ backend-python/main.py | 12 ++++++++++-- backend-python/requirements.txt | Bin 674 -> 786 bytes backend-python/requirements_without_cyac.txt | Bin 652 -> 764 bytes backend-python/routes/completion.py | 6 +++--- backend-python/routes/config.py | 2 +- backend-python/routes/midi.py | 8 ++++---- backend-python/utils/rwkv.py | 2 +- 9 files changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c0b3582..61f8fc8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,10 +63,10 @@ jobs: Expand-Archive ./python-3.10.11-embed-amd64.zip -DestinationPath ./py310 $content=Get-Content "./py310/python310._pth"; $content | ForEach-Object {if ($_.ReadCount -eq 3) {"Lib\\site-packages"} else {$_}} | Set-Content ./py310/python310._pth ./py310/python ./backend-python/get-pip.py - ./py310/python -m pip install Cython==0.29.36 + ./py310/python -m pip install Cython==3.0.4 Copy-Item -Path "${{ steps.cp310.outputs.python-path }}/../include" -Destination "py310/include" -Recurse Copy-Item -Path "${{ steps.cp310.outputs.python-path }}/../libs" -Destination "py310/libs" -Recurse - ./py310/python -m pip install cyac==1.7 + ./py310/python -m pip install cyac==1.9 git clone https://github.com/josStorer/ai00_rwkv_server --depth=1 cd ai00_rwkv_server cargo build --release diff --git a/backend-python/dep_check.py b/backend-python/dep_check.py index dcd11c2..78159e5 100644 --- a/backend-python/dep_check.py +++ b/backend-python/dep_check.py @@ -1,3 +1,5 @@ +import multipart +import fitz import safetensors import midi2audio import mido diff --git a/backend-python/main.py b/backend-python/main.py index b4275d5..f95cef9 100644 --- a/backend-python/main.py +++ b/backend-python/main.py @@ -2,10 +2,12 @@ import time start_time = time.time() +import setuptools # avoid warnings import os import sys import argparse from typing import Sequence +from contextlib import asynccontextmanager sys.path.append(os.path.dirname(os.path.realpath(__file__))) @@ -21,7 +23,14 @@ from utils.log import log_middleware from routes import completion, config, state_cache, midi, misc import global_var -app = FastAPI(dependencies=[Depends(log_middleware)]) + +@asynccontextmanager +async def lifespan(app: FastAPI): + init() + yield + + +app = FastAPI(lifespan=lifespan, dependencies=[Depends(log_middleware)]) app.add_middleware( CORSMiddleware, @@ -38,7 +47,6 @@ app.include_router(misc.router) app.include_router(state_cache.router) -@app.on_event("startup") def init(): global_var.init() cmd_params = os.environ["RWKV_RUNNER_PARAMS"] diff --git a/backend-python/requirements.txt b/backend-python/requirements.txt index 9075ce7a6c410b6f8eee6596f4affded386a0130..be995a658d165fa3f8302ba552d40d9e81b8a289 100644 GIT binary patch delta 308 zcmZ3)I*DyU1f$u+NM%-I1|tTeiH*|Qh71M_CJcH&l9z#tp_HMFA(J7QA)ld$A&RWNu1RT%#vlYW(Jx*IhIMa9^sAvhDrusps4{2E(~s9Qw@Qt zA?`4R+FA*;GXv<-JO*8cT%g(LX_*bM~?i9olPz}*gVzZqDEGtf+!4v^14egeswfMo$A CtS)~5 delta 194 zcmeyv+QT{_g3)+lq%x}^gE@oA#71dNO9oR0Jq9BNUIs3PQid{yOon8Je1;;1JO*1J zGyuyP0ZD_2$F-de!O994Dj8B35`juez{)`i4S`Aw!OG2{YKnozf#h?*27xTG1Y*<4 z#*EgiCLjYR7c(X@noPdRsLpB(