updated skeleton with true data

This commit is contained in:
2025-12-09 08:40:18 +01:00
parent 61e6644158
commit 8cd91b6f22
27 changed files with 1193 additions and 14 deletions

View File

@ -0,0 +1,4 @@
import torch
def device():
return 'cuda' if torch.cuda.is_available() else 'cpu'

View File

@ -0,0 +1,18 @@
import redis, json, os
REDIS_HOST=os.environ.get("REDIS_HOST","redis")
r=redis.Redis(host=REDIS_HOST, port=6379, db=0)
QUEUE="tts_queue"
RESULT="tts_result"
def fetch_job():
data=r.rpop(QUEUE)
if not data:
return None
return json.loads(data)
def store_result(job_id:str, audio:bytes, mime:str):
key=f"{RESULT}:{job_id}"
obj={"audio": audio.hex(), "mime": mime}
r.set(key, json.dumps(obj))