Add exclusive LLM and video modes with isolated LTX worker and job API
This commit is contained in:
1 parent
7910307cfb
commit
bec79a23aa
21 files changed
+534
-18
No files matched your search
+2
-1
@@ -19,7 +19,7 @@ class InferenceError(ValueError):
|
||||
class Scheduler:
|
||||
"""FIFO admission; same-profile requests share configured slots, switches drain."""
|
||||
def __init__(self, worker):
|
||||
self.worker=worker;self.cv=threading.Condition();self.queue=[];self.key=None;self.active=0;self.transition=False
|
||||
self.worker=worker;self.cv=threading.Condition();self.queue=[];self.key=None;self.active=0;self.transition=False;self.gpu_mode="llm"
|
||||
def status(self):
|
||||
with self.cv:return dict(active_requests=self.active,waiting_requests=len(self.queue),switching=self.transition)
|
||||
@contextlib.contextmanager
|
||||
@@ -30,6 +30,7 @@ class Scheduler:
|
||||
self.queue.append(ticket)
|
||||
try:
|
||||
while True:
|
||||
if self.gpu_mode!="llm":raise InferenceError("Video-Modus aktiv oder Moduswechsel läuft; GPU-Aufträge sind gesperrt.")
|
||||
if not allowed():raise InferenceError('Endpunkt wird gestoppt oder Profil ist nicht mehr aktiviert.')
|
||||
if self.queue[0] is ticket and not self.transition and (not self.active or (self.key==key and self.active<slots)):
|
||||
self.queue.pop(0);self.active+=1;claimed=True
|
||||
|
||||
Reference in new issue
Block a user