fixed the long wait
Browse files- App/TTS/TTSRoutes.py +6 -0
- App/app.py +1 -3
App/TTS/TTSRoutes.py
CHANGED
@@ -54,6 +54,12 @@ async def descript_unsplash(req: DescriptSfxRequest):
|
|
54 |
async def voices_descript():
|
55 |
return await descript_tts.get_voices()
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
@tts_router.post("/status")
|
58 |
async def search_id(req: StatusRequest):
|
59 |
return await tts.check_status(req)
|
|
|
54 |
async def voices_descript():
|
55 |
return await descript_tts.get_voices()
|
56 |
|
57 |
+
|
58 |
+
@tts_router.get("/descript_auto_refresh")
|
59 |
+
async def auto_refresh():
|
60 |
+
return await descript_tts.start_token_refresh_schedule()
|
61 |
+
|
62 |
+
|
63 |
@tts_router.post("/status")
|
64 |
async def search_id(req: StatusRequest):
|
65 |
return await tts.check_status(req)
|
App/app.py
CHANGED
@@ -3,7 +3,6 @@ from fastapi import FastAPI
|
|
3 |
from fastapi.middleware.gzip import GZipMiddleware
|
4 |
|
5 |
from .TTS.TTSRoutes import tts_router
|
6 |
-
from .TTS.utils.Descript import DescriptTTS
|
7 |
from .Embedding.EmbeddingRoutes import embeddigs_router
|
8 |
from .Chat.PoeChatrouter import chat_router
|
9 |
|
@@ -11,7 +10,7 @@ from fastapi.middleware.cors import CORSMiddleware
|
|
11 |
|
12 |
from fastapi_cache import FastAPICache
|
13 |
from fastapi_cache.backends.inmemory import InMemoryBackend
|
14 |
-
|
15 |
import logging
|
16 |
|
17 |
|
@@ -39,7 +38,6 @@ app.add_middleware(GZipMiddleware, minimum_size=1000)
|
|
39 |
@app.on_event("startup")
|
40 |
async def startup():
|
41 |
FastAPICache.init(InMemoryBackend())
|
42 |
-
await tts_object.start_token_refresh_schedule()
|
43 |
|
44 |
|
45 |
@app.get("/")
|
|
|
3 |
from fastapi.middleware.gzip import GZipMiddleware
|
4 |
|
5 |
from .TTS.TTSRoutes import tts_router
|
|
|
6 |
from .Embedding.EmbeddingRoutes import embeddigs_router
|
7 |
from .Chat.PoeChatrouter import chat_router
|
8 |
|
|
|
10 |
|
11 |
from fastapi_cache import FastAPICache
|
12 |
from fastapi_cache.backends.inmemory import InMemoryBackend
|
13 |
+
|
14 |
import logging
|
15 |
|
16 |
|
|
|
38 |
@app.on_event("startup")
|
39 |
async def startup():
|
40 |
FastAPICache.init(InMemoryBackend())
|
|
|
41 |
|
42 |
|
43 |
@app.get("/")
|