Add resident ACE-Step music runtime, profiles and Studio
This commit is contained in:
1 parent
da5c280121
commit
79e4f315b5
32 files changed
+633
-34
No files matched your search
+28
@@ -0,0 +1,28 @@
|
||||
# ACE-Step in Athena Deck
|
||||
|
||||
Original runtime: https://github.com/ace-step/ACE-Step-1.5
|
||||
Runtime revision: dce621408bee8c31b4fcf4811682eb9359e1bc94 (the old router's official image revision).
|
||||
Model: https://huggingface.co/ACE-Step/acestep-v15-xl-sft
|
||||
Base package: https://huggingface.co/ACE-Step/Ace-Step1.5, revision 19671f406d603126926c1b7e2adc169acbcade22.
|
||||
Vendor installation / API: https://ace-step.github.io/ACE-Step-1.5/en/INSTALL and https://ace-step.github.io/ACE-Step-1.5/en/API.
|
||||
|
||||
Own Python environment with PyTorch 2.10 / CUDA 12.8. No changes to ComfyUI, VoxCPM, OmniVoice or YuE2 packages. Deck's runtime page installs the source and dependencies without loading models.
|
||||
|
||||
XL-SFT uses INT8 weight-only quantization and vendor CPU offloading on RTX 5080. The 1.7B music LM uses the native PyTorch backend. Default generation: 50 steps, CFG 7, ODE/Euler, shift 1, batch 1, normalization -1 dB, no fades, latent shift 0 / rescale 1. Target duration defaults to 30 seconds; instrumentals and lyrics are supported. Each job reserves Deck's music GPU lease. Successful jobs keep the process and weights; errors, cancellation and explicit mode changes unload them.
|
||||
|
||||
`POST /v1/audio/music` uses the same API port and token as existing music. ACE fields: `model`, `style`, `lyrics`, `duration_seconds`, `steps`, `guidance`, `seed`, `thinking`, `instrumental`, `bpm`, `language`. Output: PCM-16 WAV. YuE2 routes and its own parameter behavior remain available. Model family dispatch validates before generation; ACE-only overrides are rejected for YuE2.
|
||||
|
||||
The music test page changes controls according to the selected model. ACE-Step Studio is a lightweight separate UI container on loopback 8131; it forwards requests to Deck and has no GPU/model access. This is a Deck-integrated generation interface, not a copy of the old community UI's library, cover/repaint or LoRA management. Those advanced tasks are not implemented by this text-to-music adapter.
|
||||
|
||||
## Sources and restoration
|
||||
|
||||
Each of the 30 recipe files is a normal Deck library entry with official repository, immutable revision and content hash. Imports verify the original file against Hub SHA-256 or Git blob hash, then verify the imported copy. Locally changed small Python model files from the old router are fetched from the corresponding pinned official revision; old files remain untouched. Runtime-owned code synchronization operates on session copies and cannot alter library files.
|
||||
|
||||
Configuration backups include profile/component IDs, runtime version/installation recipe and the Studio container build recipe / encrypted connection configuration. Restoration re-downloads recipe files and rebuilds the isolated runtime. The Hub allowlist includes the exact auxiliary ACE files, rather than permitting arbitrary Python files. No weights, prompts, songs, logs or environments enter configuration backups. Full recovery on a blank Debian server remains a separate acceptance test.
|
||||
|
||||
## Prepared Athena migration
|
||||
|
||||
`deploy/import_acestep.py`: import from old checkpoints while production keeps running.
|
||||
`deploy/activate_acestep.py STATE`: after stopping Deck, add `ACE-Step 1.5 XL-SFT` / API-ID `ace-step-xl-sft`, assign all 29 components and publish it. Leaves mode and other profile settings unchanged. Rejects API-ID conflicts and reuses its own existing profile.
|
||||
|
||||
Before deployment, build the app image and Studio image, then obtain approval for Deck restart and a synthetic music test. Register Studio port 8131 with the native WireGuard access gateway; use DeckLinks for current access address. Never enable a public 0.0.0.0 listener for this UI.
|
||||
@@ -0,0 +1,10 @@
|
||||
window.AceStepUI=(()=>{
|
||||
const e=v=>String(v??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
|
||||
async function api(path='',data){const r=await fetch('/api/v1/acestep-runtime'+path,data?{method:'POST',headers:{'Content-Type':'application/json','X-Athena-Deck':'1'},body:JSON.stringify(data)}:{});const s=await r.json();if(!r.ok)throw Error(s.error||'Anfrage fehlgeschlagen');return s;}
|
||||
function render(){const view=document.querySelector('#view');if(view.querySelector('#acestep-page'))return;
|
||||
view.innerHTML='<div id="acestep-page"><h1>ACE-Step 1.5</h1><p>Originale Python/PyTorch-Laufzeit für ACE-Step XL-SFT mit dem 1.7B-Musik-Sprachmodell. Passendes GGUF-Paket und ein Deck-Worker sind zusätzlich erforderlich.</p><section class="card"><h2>Herunterladen und bereitmachen</h2><div id="ac-status"></div><button id="ac-install">ACE-Step 1.5 installieren</button><button id="ac-cancel" class="secondary">Installation abbrechen</button><p id="ac-message" role="status"></p><details><summary>Installationsausgabe</summary><pre id="ac-log" style="white-space:pre-wrap;max-height:320px;overflow:auto"></pre></details></section><section class="card"><h2>ACE-Step und ACE-Step Studio WebUI</h2><p>Modellfamilie erkannt. Für Generierung das Musikprofil und seine Komponenten einrichten, dann Musik → Testen verwenden. Die ACE-Step Studio-Oberfläche ist separat. Dieser Build lädt keine Gewichte, startet kein Modell und gibt kein Profil am Endpunkt frei.</p><a href="#music">Zur Musik-Bibliothek →</a></section></div>';
|
||||
const root=view.firstChild;let timer;
|
||||
async function poll(){if(!root.isConnected)return;try{const s=await api();if(!root.isConnected)return;const running=s.job?.state==='running';root.querySelector('#ac-install').disabled=s.installed||running;root.querySelector('#ac-cancel').disabled=!running;root.querySelector('#ac-status').innerHTML=`<p><strong>${s.installed?'Installiert · ACE-Step-Musikworker verfügbar':'Noch nicht installiert'}</strong></p><p>Version ${e(s.version)}</p><p>Mindestens ${e(s.required_disk_gib)} GiB freier Speicher. Eigene CUDA-Umgebung; bestehende Voice- und Bildlaufzeiten bleiben unverändert. </p>${s.job?`<p>${e(s.job.state)} · ${e(s.job.phase)}</p>${running?'<progress aria-label="ACE-Step 1.5-Installation läuft"></progress>':''}`:''}`;if(s.job){const log=await api('/log');if(root.isConnected)root.querySelector('#ac-log').textContent=log.text;}}catch(x){if(root.isConnected)root.querySelector('#ac-message').textContent=x.message;}if(root.isConnected){clearTimeout(timer);timer=setTimeout(poll,3000);}}
|
||||
for(const [id,path] of [['ac-install','/install'],['ac-cancel','/cancel']])root.querySelector('#'+id).onclick=async()=>{root.querySelector('#'+id).disabled=true;try{await api(path,{});root.querySelector('#ac-message').textContent='Aktion angenommen.';}catch(x){root.querySelector('#ac-message').textContent=x.message;}poll();};poll();}
|
||||
return {render};
|
||||
})();
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
"""ACE-Step jobs use Deck's existing GPU lease and persist weights until mode switch."""
|
||||
import json,os,shutil,subprocess,threading,time,uuid,wave
|
||||
from pathlib import Path
|
||||
from music import Music
|
||||
from profiles import acestep_recipe
|
||||
from image_test import probe
|
||||
|
||||
class AceStep(Music):
|
||||
def blockers(self,p):
|
||||
if not acestep_recipe(p['model']):return ['Dieses Modell wird nicht vom ACE-Step-Worker unterstützt.']
|
||||
result=[] if self.runtime.status()['installed'] else ['ACE-Step zuerst unter Laufzeiten installieren.']
|
||||
for role,info in acestep_recipe(p['model']).items():
|
||||
try:self.profiles._component(p['model'],role,p.get('components',{}).get(role))
|
||||
except ValueError:result.append(info['label']+' fehlt oder ist nicht zugeordnet.')
|
||||
return result
|
||||
def start(self,profile_id,lyrics='',style='',seed=1234,max_tokens=400,steps=50,wait=False,duration_seconds=30,guidance=7.0,thinking=True,instrumental=False,bpm=None,language='unknown'):
|
||||
if not isinstance(style,str) or not 1<=len(style.strip())<=2000:raise ValueError('Musikstil mit 1–2000 Zeichen eingeben.')
|
||||
if not isinstance(lyrics,str) or len(lyrics)>8000:raise ValueError('Songtext mit maximal 8000 Zeichen eingeben.')
|
||||
if type(instrumental) is not bool or type(thinking) is not bool:raise ValueError('Instrumental und Thinking müssen boolesch sein.')
|
||||
if not instrumental and not lyrics.strip():raise ValueError('Songtext eingeben oder Instrumental auswählen.')
|
||||
for value,lo,hi in ((seed,0,2**31-1),(steps,1,200)):
|
||||
if type(value) is not int or not lo<=value<=hi:raise ValueError('Ungültige ACE-Step-Parameter.')
|
||||
for value,lo,hi in ((duration_seconds,10,600),(guidance,0,20)):
|
||||
if type(value) not in (int,float) or not lo<=value<=hi:raise ValueError('Dauer: 10–600 Sekunden; Guidance: 0–20.')
|
||||
if bpm is not None and (type(bpm) is not int or not 30<=bpm<=300):raise ValueError('BPM: 30–300 oder leer.')
|
||||
if not isinstance(language,str) or len(language)>16 or not language.replace('-','').isalpha():raise ValueError('Ungültiges Sprachkürzel.')
|
||||
request=dict(lyrics=lyrics,style=style,seed=seed,steps=steps,duration_seconds=duration_seconds,guidance=guidance,thinking=thinking,instrumental=instrumental,bpm=bpm,language=language)
|
||||
return self._start_job(profile_id,request,style,seed,max_tokens,steps,wait)
|
||||
def _ensure_session(self,p):
|
||||
key=(p['id'],p['model']['id'],tuple(sorted(p['components'].items())))
|
||||
if self.session_key==key and self.process and self.process.poll() is None and self.session_ready:return
|
||||
self._unload()
|
||||
gpu=next((g for g in probe() if 'RTX 5080' in g['name'] and not g['processes'] and g['free_mib']>=11500),None)
|
||||
if not gpu:raise ValueError('RTX 5080 benötigt mindestens 11.5 GiB freien Speicher. Fremde Prozesse werden nicht beendet.')
|
||||
python,source=self.runtime.paths()
|
||||
if not python.is_file():raise ValueError('ACE-Step-Laufzeit fehlt.')
|
||||
root=self.root/('session-'+uuid.uuid4().hex);root.mkdir(mode=0o700);self.session_root=root
|
||||
def link(entry,filename):
|
||||
dest=root/'checkpoints'/filename;dest.parent.mkdir(parents=True,exist_ok=True)
|
||||
source=(self.catalog.root/entry['id']/('model'+Path(entry['file']).suffix)).resolve()
|
||||
if dest.suffix in ('.py','.json','.jinja'):shutil.copyfile(source,dest)
|
||||
else:dest.symlink_to(source)
|
||||
link(p['model'],'acestep-v15-xl-sft/'+p['model']['file'])
|
||||
for role,info in acestep_recipe(p['model']).items():
|
||||
entry=self.profiles._component(p['model'],role,p['components'][role]);link(entry,entry['file'] if info.get('repo') else 'acestep-v15-xl-sft/'+entry['file'])
|
||||
env=dict(os.environ,CUDA_VISIBLE_DEVICES=gpu['uuid'],HF_HUB_OFFLINE='1',TRANSFORMERS_OFFLINE='1',HF_HUB_DISABLE_TELEMETRY='1',ACESTEP_CHECKPOINTS_DIR=str(root/'checkpoints'),PYTHONPATH=str(source),OMP_NUM_THREADS='6')
|
||||
with self.lock:
|
||||
if self.cancel.is_set():raise InterruptedError()
|
||||
self.session_key=key;self.job.update(phase='ACE-Step XL-SFT und 1.7B-LM laden · INT8 · RTX 5080',gpu=gpu['name'])
|
||||
self.process=subprocess.Popen([str(python),str(Path(__file__).with_name('acestep_worker.py')),str(root)],stdin=subprocess.PIPE,stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL,text=True,start_new_session=True,env=env)
|
||||
result=self._await(root/'ready.json',900)
|
||||
if not result.get('ok'):raise ValueError(result['error'])
|
||||
self.session_ready=True
|
||||
def _await(self,path,timeout):
|
||||
end=time.monotonic()+timeout
|
||||
while not path.is_file():
|
||||
if self.cancel.is_set():raise InterruptedError()
|
||||
if not self.process or self.process.poll() is not None:raise ValueError('ACE-Step-Worker beendet. Laufzeit und Komponenten prüfen.')
|
||||
if time.monotonic()>end:raise ValueError('ACE-Step-Zeitlimit überschritten.')
|
||||
self.cancel.wait(.2)
|
||||
return json.loads(path.read_text())
|
||||
def _run(self,p,request,style,seed,max_tokens,steps,wait):
|
||||
release=None;state='failed';phase='ACE-Step fehlgeschlagen.';directory=self.root/self.job['id']
|
||||
try:
|
||||
release=self.scheduler.image_reservation(wait=wait,kind='music')
|
||||
if self.cancel.is_set():raise InterruptedError()
|
||||
self._ensure_session(p)
|
||||
if request is None:state='ready';phase='ACE-Step geladen · bereit für weitere Songs';return
|
||||
directory.mkdir(mode=0o700)
|
||||
with self.lock:self.job['phase']='ACE-Step erzeugt Musik · Gewichte bleiben geladen'
|
||||
self.process.stdin.write(json.dumps(dict(request,output=str(directory)))+'\n');self.process.stdin.flush()
|
||||
result=self._await(directory/'result.json',1800)
|
||||
if not result.get('ok'):raise ValueError(result['error'])
|
||||
with wave.open(str(directory/'result.wav'),'rb') as audio:
|
||||
if audio.getnframes()<1 or audio.getnchannels() not in (1,2):raise ValueError('Ungültige ACE-Step-Audioausgabe.')
|
||||
duration=audio.getnframes()/audio.getframerate()
|
||||
if (directory/'result.wav').stat().st_size>256*1024**2:raise ValueError('Audioausgabe zu groß.')
|
||||
(directory/'complete').touch();state='complete';phase='Musik fertig · ACE-Step bleibt geladen'
|
||||
with self.lock:self.job['duration_seconds']=round(duration,2)
|
||||
except InterruptedError:state='cancelled';phase='ACE-Step abgebrochen · Modell entladen'
|
||||
except Exception as exc:
|
||||
if self.cancel.is_set():state='cancelled';phase='ACE-Step abgebrochen · Modell entladen'
|
||||
else:phase=str(exc) if isinstance(exc,ValueError) else 'ACE-Step fehlgeschlagen ('+type(exc).__name__+').'
|
||||
finally:
|
||||
if state not in ('complete','ready'):self._unload()
|
||||
with self.lock:self.job.update(state=state,phase=phase,finished_at=time.time())
|
||||
if release:release()
|
||||
|
||||
class MusicRouter:
|
||||
def __init__(self,yue,ace):self.yue=yue;self.ace=ace;self.active=yue;self.lock=threading.RLock()
|
||||
@property
|
||||
def job(self):return self.active.job
|
||||
def _select(self,profile_id):
|
||||
p=next((p for p in self.yue.profiles.status()['profiles'] if p['id']==profile_id and p['kind']=='music'),None)
|
||||
if not p:raise ValueError('Musikprofil nicht gefunden.')
|
||||
if not p['runnable']:raise ValueError('Musikprofil noch nicht vollständig eingerichtet.')
|
||||
target=self.ace if acestep_recipe(p['model']) else self.yue
|
||||
if any(w.job and w.job['state']=='running' for w in (self.yue,self.ace)):raise ValueError('Musikauftrag läuft bereits.')
|
||||
if target is not self.active:self.active.close();self.active=target
|
||||
return target
|
||||
def start(self,profile_id,lyrics='',style='',**options):
|
||||
with self.lock:
|
||||
target=self._select(profile_id)
|
||||
if options.get('steps') is None:options.pop('steps')
|
||||
if target is self.yue and set(options)-{'seed','max_tokens','steps','wait'}:raise ValueError('ACE-Step-Parameter sind für dieses YuE2-Profil nicht unterstützt.')
|
||||
return target.start(profile_id,lyrics,style,**options)
|
||||
def load(self,profile_id,wait=False):
|
||||
with self.lock:return self._select(profile_id).load(profile_id,wait)
|
||||
def blockers(self,p):return (self.ace if acestep_recipe(p['model']) else self.yue).blockers(p)
|
||||
def status(self):return dict(self.active.status(),family='ACE-Step' if self.active is self.ace else 'YuE2')
|
||||
def close(self):self.yue.close();self.ace.close()
|
||||
def stop(self):return self.active.stop()
|
||||
def audio(self,ident):
|
||||
for worker in (self.active,self.ace if self.active is self.yue else self.yue):
|
||||
try:return worker.audio(ident)
|
||||
except ValueError:pass
|
||||
raise ValueError('Musik noch nicht fertig oder Auftrag unbekannt.')
|
||||
@@ -0,0 +1,10 @@
|
||||
"""Pinned, cross-repository ACE-Step package recipe."""
|
||||
ACE_REPO='ACE-Step/acestep-v15-xl-sft'
|
||||
ACE_BASE_REPO='ACE-Step/Ace-Step1.5'
|
||||
ACE_BASE_REVISION='19671f406d603126926c1b7e2adc169acbcade22'
|
||||
ACE_FILES=['model-00002-of-00004.safetensors','model-00003-of-00004.safetensors','model-00004-of-00004.safetensors','config.json','silence_latent.pt','model.safetensors.index.json','modeling_acestep_v15_xl_base.py','configuration_acestep_v15.py','apg_guidance.py']
|
||||
ACE_BASE_FILES=['vae/config.json','vae/diffusion_pytorch_model.safetensors']+[folder+'/'+name for folder in ('Qwen3-Embedding-0.6B','acestep-5Hz-lm-1.7B') for name in ('special_tokens_map.json','added_tokens.json','chat_template.jinja','vocab.json','config.json','tokenizer.json','merges.txt','model.safetensors','tokenizer_config.json')]
|
||||
ACE_COMPONENTS={**{'ace_'+str(i):dict(label='ACE-Step · '+name,files=[name]) for i,name in enumerate(ACE_FILES)},**{'ace_base_'+str(i):dict(label='ACE-Step · '+name,files=[name],repo=ACE_BASE_REPO,revision=ACE_BASE_REVISION) for i,name in enumerate(ACE_BASE_FILES)}}
|
||||
def acestep_recipe(model):
|
||||
return ACE_COMPONENTS if model.get('kind')=='music' and model.get('repo')==ACE_REPO and model.get('file')=='model-00001-of-00004.safetensors' else None
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
"""Pinned native ACE-Step runtime, isolated from every other audio worker."""
|
||||
import json,os,shutil,sys,time
|
||||
from pathlib import Path
|
||||
from ltx_original_runtime import LTXOriginalRuntime
|
||||
REVISION='dce621408bee8c31b4fcf4811682eb9359e1bc94'
|
||||
VERSION='1.5 · '+REVISION[:8]
|
||||
class AceStepRuntime(LTXOriginalRuntime):
|
||||
name='ACE-Step'
|
||||
def __init__(self,root):super().__init__(root,None)
|
||||
def paths(self):
|
||||
try:
|
||||
ident=json.loads((self.root/'active.json').read_text())['id']
|
||||
if len(ident)==32 and all(c in '0123456789abcdef' for c in ident):
|
||||
base=self.root/ident
|
||||
if (base/'ready').read_text().strip()==REVISION:return base/'python/bin/python',base/'source'
|
||||
except (OSError,ValueError,KeyError):pass
|
||||
return self.root/'missing-python',self.root/'missing-source'
|
||||
def status(self):
|
||||
python,source=self.paths()
|
||||
return dict(installed=python.is_file() and source.is_dir(),version=VERSION,job=dict(self.job) if self.job else None,required_disk_gib=30,shared_cuda=False,worker_available=True,origin='ace-step/ACE-Step-1.5 · offizieller Quellstand des bisherigen Routers',message='Eigene Python/PyTorch-Umgebung. Kein Modell wird während der Installation geladen.')
|
||||
def _run(self):
|
||||
base=self.root/self.job['id'];state='failed';phase='ACE-Step-Einrichtung fehlgeschlagen.'
|
||||
try:
|
||||
base.mkdir(mode=0o700);tmp=base/'tmp';tmp.mkdir()
|
||||
env=dict(os.environ,TMPDIR=str(tmp),PIP_NO_INPUT='1',PIP_DISABLE_PIP_VERSION_CHECK='1',GIT_TERMINAL_PROMPT='0',OMP_NUM_THREADS='2')
|
||||
self._phase('Eigene ACE-Step-Python-Umgebung erstellen');self._command([sys.executable,'-m','venv',base/'python'],env)
|
||||
python=base/'python/bin/python';source=base/'source'
|
||||
self._command([python,'-c','import sys;assert (3,11)<=sys.version_info[:2]<(3,13)'],env)
|
||||
self._phase('Offizielle ACE-Step-Quelle herunterladen')
|
||||
self._command(['git','init',source],env);self._command(['git','-C',source,'fetch','--depth','1','https://github.com/ace-step/ACE-Step-1.5.git',REVISION],env);self._command(['git','-C',source,'checkout','--detach','FETCH_HEAD'],env)
|
||||
self._phase('Eigene CUDA-Pakete installieren · andere Laufzeiten bleiben unverändert')
|
||||
self._command([python,'-m','pip','install','--no-cache-dir','torch==2.10.0','torchvision==0.25.0','torchaudio==2.10.0','--index-url','https://download.pytorch.org/whl/cu128'],env)
|
||||
self._phase('Geprüfte ACE-Step-Abhängigkeiten installieren')
|
||||
self._command([python,'-m','pip','install','--no-cache-dir','-r',Path(__file__).parent/'deploy/acestep-requirements.lock'],env)
|
||||
self._command([python,'-m','pip','install','--no-deps',source],env)
|
||||
self._phase('Handler und CPU-Import prüfen · kein Modellstart')
|
||||
self._command([python,'-c','from acestep.handler import AceStepHandler;from acestep.llm_inference import LLMHandler;from acestep.inference import generate_music;import torch;assert torch.version.cuda'],dict(env,CUDA_VISIBLE_DEVICES=''))
|
||||
if self.cancel.is_set():raise InterruptedError()
|
||||
(base/'ready').write_text(REVISION);marker=self.root/'active.tmp';marker.write_text(json.dumps(dict(id=base.name)));marker.replace(self.root/'active.json')
|
||||
state='complete';phase='ACE-Step installiert · Musikprofil unter Musikgenerierung einrichten'
|
||||
except InterruptedError:phase='ACE-Step-Einrichtung abgebrochen.'
|
||||
except Exception as exc:phase=str(exc)
|
||||
finally:
|
||||
with self.lock:self.process=None;self.job.update(state=state,phase=phase,finished_at=time.time());self._save()
|
||||
@@ -0,0 +1,62 @@
|
||||
"""Resident, offline ACE-Step worker. Own runtime; no shared package changes."""
|
||||
import contextlib,json,sys
|
||||
from pathlib import Path
|
||||
|
||||
def write(root,name,data):
|
||||
temp=root/(name+'.tmp');temp.write_text(json.dumps(data));temp.replace(root/name)
|
||||
|
||||
def load(root):
|
||||
from acestep.handler import AceStepHandler
|
||||
from acestep.llm_inference import LLMHandler
|
||||
dit=AceStepHandler()
|
||||
# The vendor precheck assumes a turbo model even when XL-SFT is selected.
|
||||
# Deck validates its exact package; never auto-download an unrelated model.
|
||||
def local_precheck(**kwargs):
|
||||
from acestep_models import ACE_FILES,ACE_BASE_FILES
|
||||
files=['acestep-v15-xl-sft/'+f for f in ['model-00001-of-00004.safetensors',*ACE_FILES]]+ACE_BASE_FILES
|
||||
if not all((root/'checkpoints'/f).is_file() for f in files):return 'Deck component missing',False
|
||||
return None
|
||||
dit._ensure_models_present=local_precheck
|
||||
status,ok=dit.initialize_service(project_root=str(root),config_path='acestep-v15-xl-sft',device='cuda',offload_to_cpu=True,offload_dit_to_cpu=True,quantization='int8_weight_only',use_mlx_dit=False)
|
||||
if not ok:raise RuntimeError('DiT initialization failed')
|
||||
# Refuse silent fallback to BF16, which does not fit this 16-GiB card.
|
||||
if dit.quantization!='int8_weight_only':raise RuntimeError('Required INT8 quantization unavailable')
|
||||
lm=LLMHandler()
|
||||
status,ok=lm.initialize(checkpoint_dir=str(root/'checkpoints'),lm_model_path='acestep-5Hz-lm-1.7B',backend='pt',device='cuda',offload_to_cpu=True)
|
||||
if not ok:raise RuntimeError('LM initialization failed')
|
||||
return dit,lm
|
||||
|
||||
def generate(handlers,request,output):
|
||||
import soundfile as sf
|
||||
from acestep.inference import GenerationParams,GenerationConfig,generate_music
|
||||
params=GenerationParams(caption=request['style'],lyrics=request['lyrics'] or '[Instrumental]',instrumental=request['instrumental'],duration=request['duration_seconds'],inference_steps=request['steps'],guidance_scale=request['guidance'],seed=request['seed'],thinking=request['thinking'],vocal_language=request['language'],bpm=request['bpm'],infer_method='ode',sampler_mode='euler',shift=1.0,use_adg=False,enable_normalization=True,normalization_db=-1.0,fade_in_duration=0,fade_out_duration=0,latent_shift=0,latent_rescale=1)
|
||||
config=GenerationConfig(batch_size=1,use_random_seed=False,seeds=[request['seed']],audio_format='wav')
|
||||
result=generate_music(*handlers,params,config,save_dir=None,progress=lambda *args,**kwargs:None)
|
||||
if not result.success or not result.audios:raise RuntimeError('ACE-Step generation failed')
|
||||
audio=result.audios[0];tensor=audio['tensor'];rate=audio['sample_rate']
|
||||
sf.write(output/'result.wav',tensor.detach().float().cpu().numpy().T,rate,subtype='PCM_16')
|
||||
return dict(ok=True,duration_seconds=tensor.shape[-1]/rate)
|
||||
|
||||
def failure(exc):
|
||||
return dict(ok=False,error='ACE-Step: GPU-Speicher reicht nicht aus.' if 'outofmemory' in type(exc).__name__.lower() or 'out of memory' in str(exc).lower() else 'ACE-Step fehlgeschlagen ('+type(exc).__name__+'). Laufzeit und Komponenten prüfen.')
|
||||
|
||||
def main():
|
||||
root=Path(sys.argv[1])
|
||||
with (root/'worker.log').open('w') as log,contextlib.redirect_stdout(log),contextlib.redirect_stderr(log):
|
||||
try:handlers=load(root)
|
||||
except Exception as exc:
|
||||
import traceback;traceback.print_exc();write(root,'ready.json',failure(exc));return 1
|
||||
write(root,'ready.json',dict(ok=True))
|
||||
# Vendor generation logs can contain captions; never retain them.
|
||||
from loguru import logger
|
||||
logger.remove()
|
||||
for line in sys.stdin:
|
||||
request=json.loads(line);output=Path(request.pop('output'))
|
||||
try:
|
||||
with open('/dev/null','w') as sink,contextlib.redirect_stdout(sink),contextlib.redirect_stderr(sink):result=generate(handlers,request,output)
|
||||
except Exception as exc:
|
||||
import traceback
|
||||
result=failure(exc);result['diagnostic']=[dict(file=Path(f.filename).name,line=f.lineno,function=f.name) for f in traceback.extract_tb(exc.__traceback__)]
|
||||
write(output,'result.json',result)
|
||||
return 0
|
||||
if __name__=='__main__':sys.exit(main())
|
||||
@@ -25,6 +25,7 @@ function appearancePage(){
|
||||
}
|
||||
async function refresh(){if(refreshing)return;refreshing=true;const page=location.hash.slice(1)||'dashboard';document.querySelectorAll('nav a').forEach(a=>a.classList.toggle('active',a.hash==='#'+page));try{error.textContent='';let html;
|
||||
if(['separator-runtime','separator-test','separation'].includes(page)){SeparatorUI.render(page!=='separator-runtime');return;}
|
||||
if(page==='acestep-runtime'){AceStepUI.render();return;}
|
||||
if(page==='audio-cpp-runtime'){AudioCppUI.render();return;}
|
||||
if(page==='ltx-original-runtime'){LTXOriginalUI.render();return;}
|
||||
if(['video','video-runtime'].includes(page)){VideoUI.runtime();return;}
|
||||
|
||||
@@ -97,7 +97,7 @@ def validate(doc):
|
||||
validate_profiles(settings['separator-profiles.json'])
|
||||
validate_record(doc.get('credentials'))
|
||||
runtimes=doc.get('runtimes')
|
||||
if not isinstance(runtimes,dict) or set(runtimes)-{'llama','llama_builds','image','tts','enhancers','swarm_nodes','ltx_original','audio_cpp','separator','voxcpm','omnivoice'} or not {'llama','llama_builds','image','tts','enhancers','swarm_nodes'}<=set(runtimes):raise ValueError('Ungültiges Laufzeitrezept.')
|
||||
if not isinstance(runtimes,dict) or set(runtimes)-{'llama','llama_builds','image','tts','enhancers','swarm_nodes','ltx_original','audio_cpp','separator','voxcpm','omnivoice','acestep'} or not {'llama','llama_builds','image','tts','enhancers','swarm_nodes'}<=set(runtimes):raise ValueError('Ungültiges Laufzeitrezept.')
|
||||
if 'separator' in runtimes:
|
||||
from separator_runtime import MODELS
|
||||
value=runtimes['separator']
|
||||
@@ -105,6 +105,7 @@ def validate(doc):
|
||||
if 'sources' in value:
|
||||
from separator_runtime import SOURCES
|
||||
if value['sources']!={name:SOURCES[name] for name in value['models']}:raise ValueError('Audio-Separator-Quellen stimmen nicht mit dem geprüften Rezept überein.')
|
||||
if 'acestep' in runtimes and type(runtimes['acestep']) is not bool:raise ValueError('Ungültige ACE-Step-Laufzeit.')
|
||||
if 'omnivoice' in runtimes and type(runtimes['omnivoice']) is not bool:raise ValueError('Ungültige OmniVoice-Laufzeit.')
|
||||
if 'voxcpm' in runtimes and type(runtimes['voxcpm']) is not bool:raise ValueError('Ungültige VoxCPM-Laufzeit.')
|
||||
if 'audio_cpp' in runtimes and type(runtimes['audio_cpp']) is not bool:raise ValueError('Ungültige audio.cpp-Laufzeit.')
|
||||
@@ -176,6 +177,8 @@ class Backup:
|
||||
if getattr(s,'separator_runtime',None):
|
||||
from separator_runtime import SOURCES
|
||||
separator=s.separator_runtime.status();document['runtimes']['separator']=dict(installed=separator['installed'],models=[m['id'] for m in separator['models'] if m['installed']],sources={m['id']:SOURCES[m['id']] for m in separator['models'] if m['installed']});document['runtime_versions']['separator']=separator['version']
|
||||
if getattr(s,'acestep_runtime',None):
|
||||
document['runtimes']['acestep']=s.acestep_runtime.status()['installed'];document['runtime_versions']['acestep']=s.acestep_runtime.status()['version']
|
||||
if getattr(s,'omnivoice_runtime',None):
|
||||
document['runtimes']['omnivoice']=s.omnivoice_runtime.status()['installed'];document['runtime_versions']['omnivoice']=s.omnivoice_runtime.status()['version']
|
||||
if getattr(s,'voxcpm_runtime',None):
|
||||
@@ -212,6 +215,9 @@ class Backup:
|
||||
elif s.network.status().get('enabled') or s.network.status().get('mode')!='lan':blockers.append('Deck-Tunnel vor Netzwerk-Restore im bestätigten LAN-Modus deaktivieren.')
|
||||
if doc['network']['mode']!='lan':warnings.append('Tunnelzugang wird mit Rückfallzeit aktiviert und muss über den Tunnel bestätigt werden.')
|
||||
versions=doc.get('runtime_versions',{})
|
||||
if versions.get('acestep'):
|
||||
from acestep_runtime import VERSION as ACE_VERSION
|
||||
if versions['acestep']!=ACE_VERSION:blockers.append('Backup verlangt eine andere ACE-Step-Version. Passende Deck-Version verwenden.')
|
||||
if versions.get('omnivoice'):
|
||||
from omnivoice_runtime import VERSION as OMNIVOICE_VERSION
|
||||
if versions['omnivoice']!=OMNIVOICE_VERSION:blockers.append('Backup verlangt eine andere OmniVoice-Version. Passende Deck-Version verwenden.')
|
||||
@@ -227,7 +233,7 @@ class Backup:
|
||||
if versions.get('ltx_original'):
|
||||
from ltx_original_runtime import DESKTOP_REV,LTX_REV
|
||||
if versions['ltx_original']!=dict(desktop=DESKTOP_REV,inference=LTX_REV):blockers.append('Backup verlangt eine andere originale LTX-Version. Passende Deck-Version verwenden.')
|
||||
if versions and {k:v for k,v in versions.items() if k not in ('ltx_original','audio_cpp','separator','voxcpm','omnivoice')}!=dict(image=dict(comfy=s.image_runtime.status()['comfy_revision'],gguf=s.image_runtime.status()['gguf_revision']),tts=s.tts_runtime.status()['revision']):blockers.append('Backup verlangt andere Bild-/TTS-Laufzeitversionen. Passende Deck-Version oder geprüftes Runtime-Upgrade verwenden.')
|
||||
if versions and {k:v for k,v in versions.items() if k not in ('ltx_original','audio_cpp','separator','voxcpm','omnivoice','acestep')}!=dict(image=dict(comfy=s.image_runtime.status()['comfy_revision'],gguf=s.image_runtime.status()['gguf_revision']),tts=s.tts_runtime.status()['revision']):blockers.append('Backup verlangt andere Bild-/TTS-Laufzeitversionen. Passende Deck-Version oder geprüftes Runtime-Upgrade verwenden.')
|
||||
for c in doc['services']:
|
||||
if not c.get('registry') and not c.get('build_recipe'):warnings.append(c['name']+': Image nur lokal vorhanden; Registry-/Buildquelle fehlt.')
|
||||
ports=s.endpoint.allowed_ports
|
||||
@@ -252,7 +258,7 @@ class Backup:
|
||||
if len(set(data['services']))!=len(data['services']) or any(name not in services for name in data['services']):raise ValueError('Unbekannter Zusatzdienst.')
|
||||
if any(not services[name].get('registry') and not services[name].get('build_recipe') for name in data['services']):raise ValueError('Gewählter Dienst hat keine Wiederherstellungsquelle.')
|
||||
s=self.server
|
||||
if s.catalog.pending or s.catalog.job and s.catalog.job['state']=='downloading' or s.runtime.busy or any((getattr(o,'job',None) or {}).get('state')=='running' for o in (s.image_runtime,s.tts_runtime,s.ltx_original_runtime,getattr(s,'audio_cpp_runtime',None),getattr(s,'music',None),getattr(s,'separator_runtime',None),getattr(s,'separator_tests',None),s.prompt_enhancer,s.auto_tests,s.chat_tests,s.image_tests,s.tts_tests,s.stt)):raise ValueError('Zuerst laufende Downloads, Builds und Tests abschließen oder abbrechen.')
|
||||
if s.catalog.pending or s.catalog.job and s.catalog.job['state']=='downloading' or s.runtime.busy or any((getattr(o,'job',None) or {}).get('state')=='running' for o in (s.image_runtime,s.tts_runtime,s.ltx_original_runtime,getattr(s,'audio_cpp_runtime',None),getattr(s,'acestep_runtime',None),getattr(s,'music',None),getattr(s,'separator_runtime',None),getattr(s,'separator_tests',None),s.prompt_enhancer,s.auto_tests,s.chat_tests,s.image_tests,s.tts_tests,s.stt)):raise ValueError('Zuerst laufende Downloads, Builds und Tests abschließen oder abbrechen.')
|
||||
self.cancel.clear();self.job=dict(id=secrets.token_hex(16),state='running',phase='Wiederherstellung vorbereiten',completed=0,total=len(doc['models'])+len(data['services'])+5,items=[],started_at=time.time(),theme=doc.get('theme','deck'))
|
||||
self._save();threading.Thread(target=self._restore,args=(copy.deepcopy(doc),data['services'],data['restore_credentials']),daemon=True).start();self.plan=None
|
||||
return self.status()
|
||||
@@ -278,6 +284,8 @@ class Backup:
|
||||
self._phase('Vorhandene Bild-/Videolaufzeit prüfen oder installieren');s.image_runtime.start();self._wait(s.image_runtime.status)
|
||||
if r['tts'] and not s.tts_runtime.status()['installed']:
|
||||
self._phase('TTS-Laufzeit und Zusatzdateien installieren');s.tts_runtime.start();self._wait(s.tts_runtime.status)
|
||||
if r.get('acestep') and not s.acestep_runtime.status()['installed']:
|
||||
self._phase('ACE-Step-Laufzeit installieren');s.acestep_runtime.start();self._wait(s.acestep_runtime.status)
|
||||
if r.get('audio_cpp') and not s.audio_cpp_runtime.status()['installed']:
|
||||
self._phase('audio.cpp-Laufzeit installieren');s.audio_cpp_runtime.start();self._wait(s.audio_cpp_runtime.status)
|
||||
if r.get('omnivoice') and not s.omnivoice_runtime.status()['installed']:
|
||||
@@ -439,6 +447,7 @@ class Backup:
|
||||
if getattr(self.server,'music',None):self.server.music.stop()
|
||||
if getattr(self.server,'omnivoice_runtime',None):self.server.omnivoice_runtime.stop()
|
||||
if getattr(self.server,'voxcpm_runtime',None):self.server.voxcpm_runtime.stop()
|
||||
if getattr(self.server,'acestep_runtime',None):self.server.acestep_runtime.stop()
|
||||
if getattr(self.server,'audio_cpp_runtime',None):self.server.audio_cpp_runtime.stop()
|
||||
self.server.prompt_enhancer.stop()
|
||||
return {'cancellation_requested':True}
|
||||
+9
-1
@@ -64,6 +64,12 @@ def file_role(filename):
|
||||
role,label='auxiliary','Zusatzkomponente'
|
||||
elif 'tokenizer' in PurePosixPath(name).name or name.endswith('.tiktoken'):
|
||||
role,label='tokenizer','Tokenizer-Datei'
|
||||
elif parts and parts[0]=='qwen3-embedding-0.6b':
|
||||
role,label='text_encoder','ACE-Step-Textencoder'
|
||||
elif parts and parts[0]=='acestep-5hz-lm-1.7b':
|
||||
role,label='auxiliary','ACE-Step-Musik-Sprachmodell'
|
||||
elif PurePosixPath(name).name in ('model-00002-of-00004.safetensors','model-00003-of-00004.safetensors','model-00004-of-00004.safetensors'):
|
||||
role,label='auxiliary','Gewichts-Teildatei'
|
||||
elif name.endswith(('.gguf','.safetensors')):
|
||||
role,label='model','Modelldatei'
|
||||
else:
|
||||
@@ -203,7 +209,9 @@ class Catalog:
|
||||
files=[]
|
||||
for f in data.get('siblings',[]):
|
||||
name=f['rfilename'];p=PurePosixPath(name)
|
||||
allowed=p.suffix.lower() in ('.gguf','.safetensors','.json','.tiktoken') or (repo=='openbmb/VoxCPM2' and name=='audiovae.pth')
|
||||
from acestep_models import ACE_REPO,ACE_BASE_REPO,ACE_FILES,ACE_BASE_FILES
|
||||
recipe_file=(repo==ACE_REPO and name in ACE_FILES) or (repo==ACE_BASE_REPO and name in ACE_BASE_FILES) or (repo=='k2-fsa/OmniVoice' and name=='chat_template.jinja')
|
||||
allowed=recipe_file or p.suffix.lower() in ('.gguf','.safetensors','.json','.tiktoken') or (repo=='openbmb/VoxCPM2' and name=='audiovae.pth')
|
||||
if p.is_absolute() or '..' in p.parts or not allowed:continue
|
||||
size=f.get('size',f.get('lfs',{}).get('size'))
|
||||
if not isinstance(size,int) or size<1:continue
|
||||
|
||||
+2
-1
@@ -14,9 +14,10 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends python3-cryptography ffmpeg libsndfile1 && rm -rf /var/lib/apt/lists/*
|
||||
WORKDIR /app
|
||||
COPY deploy/image-requirements.lock /app/deploy/image-requirements.lock
|
||||
COPY deploy/acestep-requirements.lock /app/deploy/acestep-requirements.lock
|
||||
COPY deploy/tts-requirements.lock /app/deploy/tts-requirements.lock
|
||||
COPY deploy/ltx-original-requirements.lock /app/deploy/ltx-original-requirements.lock
|
||||
COPY embeddings.py voxcpm_test.py voxcpm_worker.py voxcpm_runtime.py separator_sources.json separator.py separator_runtime.py separator_worker.py music.py audio_cpp_runtime.py ltx_original_runtime.py ltx_original_entry.py video_original.py backup.py backup_codec.py audio_policy.py prompt_enhancer.py prompt_enhancer_worker.py api_compat.py responses_compat.py stt.py execution_setup.py tts_runtime.py tts_test.py tts_worker.py auto_test.py chat_test.py endpoint.py inference.py docker_support.py image_encoder_node.py image_runtime.py image_test.py image_upload.py profiles.py capacity.py server.py runtime.py video.py video_proxy.py video_comfy.py video_comfy_node.py video_comfy_proxy.py catalog.py hub_auth.py auth.py collect_hardware.py dashboard_data.py dashboard_history.py /app/
|
||||
COPY acestep_models.py acestep.py acestep_worker.py acestep_runtime.py acestep-ui.js embeddings.py voxcpm_test.py voxcpm_worker.py voxcpm_runtime.py separator_sources.json separator.py separator_runtime.py separator_worker.py music.py audio_cpp_runtime.py ltx_original_runtime.py ltx_original_entry.py video_original.py backup.py backup_codec.py audio_policy.py prompt_enhancer.py prompt_enhancer_worker.py api_compat.py responses_compat.py stt.py execution_setup.py tts_runtime.py tts_test.py tts_worker.py auto_test.py chat_test.py endpoint.py inference.py docker_support.py image_encoder_node.py image_runtime.py image_test.py image_upload.py profiles.py capacity.py server.py runtime.py video.py video_proxy.py video_comfy.py video_comfy_node.py video_comfy_proxy.py catalog.py hub_auth.py auth.py collect_hardware.py dashboard_data.py dashboard_history.py /app/
|
||||
COPY voice-ui.js voxcpm-ui.js separator-ui.js music-ui.js audio-cpp-ui.js ltx-original-ui.js backup-ui.js video-ui.js stt-ui.js tts-ui.js auto-test-ui.js chat-test-ui.js endpoint-ui.js docker-ui.js image-test-ui.js profiles-ui.js dashboard-ui.js index.html app.js studio.js runtime-ui.js catalog-ui.js style.css dashboard.css themes.css login.html login.js access-ui.js network-ui.js /app/
|
||||
COPY deploy/docker_backup.py /app/deploy/docker_backup.py
|
||||
COPY network/__init__.py network/client.py network/config.py network/rpc.py /app/network/
|
||||
|
||||
@@ -3,8 +3,8 @@ FROM ${DECK_RUNTIME_IMAGE}
|
||||
USER root
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends python3-cryptography ffmpeg libsndfile1 && rm -rf /var/lib/apt/lists/*
|
||||
WORKDIR /app
|
||||
COPY embeddings.py voxcpm_test.py voxcpm_worker.py voxcpm_runtime.py separator_sources.json separator.py separator_runtime.py separator_worker.py music.py audio_cpp_runtime.py ltx_original_runtime.py ltx_original_entry.py video_original.py backup.py backup_codec.py audio_policy.py prompt_enhancer.py prompt_enhancer_worker.py api_compat.py responses_compat.py stt.py execution_setup.py tts_runtime.py tts_test.py tts_worker.py auto_test.py chat_test.py endpoint.py inference.py docker_support.py image_encoder_node.py image_runtime.py image_test.py image_upload.py profiles.py capacity.py server.py runtime.py video.py video_proxy.py video_comfy.py video_comfy_node.py video_comfy_proxy.py catalog.py hub_auth.py auth.py collect_hardware.py dashboard_data.py dashboard_history.py voice-ui.js voxcpm-ui.js separator-ui.js music-ui.js audio-cpp-ui.js ltx-original-ui.js backup-ui.js video-ui.js stt-ui.js tts-ui.js auto-test-ui.js chat-test-ui.js endpoint-ui.js docker-ui.js image-test-ui.js profiles-ui.js dashboard-ui.js index.html app.js studio.js runtime-ui.js catalog-ui.js style.css dashboard.css themes.css login.html login.js access-ui.js network-ui.js omnivoice_runtime.py omnivoice_worker.py /app/
|
||||
COPY deploy/image-requirements.lock deploy/tts-requirements.lock deploy/ltx-original-requirements.lock deploy/docker_backup.py deploy/voxcpm-requirements.lock deploy/patch_yue2_residency.py deploy/omnivoice-requirements.lock /app/deploy/
|
||||
COPY acestep_models.py acestep.py acestep_worker.py acestep_runtime.py acestep-ui.js embeddings.py voxcpm_test.py voxcpm_worker.py voxcpm_runtime.py separator_sources.json separator.py separator_runtime.py separator_worker.py music.py audio_cpp_runtime.py ltx_original_runtime.py ltx_original_entry.py video_original.py backup.py backup_codec.py audio_policy.py prompt_enhancer.py prompt_enhancer_worker.py api_compat.py responses_compat.py stt.py execution_setup.py tts_runtime.py tts_test.py tts_worker.py auto_test.py chat_test.py endpoint.py inference.py docker_support.py image_encoder_node.py image_runtime.py image_test.py image_upload.py profiles.py capacity.py server.py runtime.py video.py video_proxy.py video_comfy.py video_comfy_node.py video_comfy_proxy.py catalog.py hub_auth.py auth.py collect_hardware.py dashboard_data.py dashboard_history.py voice-ui.js voxcpm-ui.js separator-ui.js music-ui.js audio-cpp-ui.js ltx-original-ui.js backup-ui.js video-ui.js stt-ui.js tts-ui.js auto-test-ui.js chat-test-ui.js endpoint-ui.js docker-ui.js image-test-ui.js profiles-ui.js dashboard-ui.js index.html app.js studio.js runtime-ui.js catalog-ui.js style.css dashboard.css themes.css login.html login.js access-ui.js network-ui.js omnivoice_runtime.py omnivoice_worker.py /app/
|
||||
COPY deploy/acestep-requirements.lock deploy/image-requirements.lock deploy/tts-requirements.lock deploy/ltx-original-requirements.lock deploy/docker_backup.py deploy/voxcpm-requirements.lock deploy/patch_yue2_residency.py deploy/omnivoice-requirements.lock /app/deploy/
|
||||
COPY network/__init__.py network/client.py network/config.py network/rpc.py /app/network/
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 HOME=/tmp \
|
||||
DECK_BIND_HOST=0.0.0.0 DECK_STATE_DIR=/var/lib/deck \
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# Tested upstream image sha256:95652cd780c78a1b1a7f6f0335530430f0ae53d96c7c12d59f9f39fa23d38567
|
||||
transformers==4.57.6
|
||||
diffusers==0.37.1
|
||||
gradio==6.2.0
|
||||
torchao==0.16.0
|
||||
torchcodec==0.10.0
|
||||
accelerate==1.12.0
|
||||
peft==0.18.1
|
||||
lightning==2.6.1
|
||||
lycoris-lora==3.4.0
|
||||
numba==0.63.1
|
||||
numpy==2.3.5
|
||||
soundfile==0.13.1
|
||||
vector-quantize-pytorch==1.27.20
|
||||
loguru==0.7.3
|
||||
pytorch-wavelets==1.3.0
|
||||
pywavelets==1.9.0
|
||||
scipy==1.17.0
|
||||
einops==0.8.2
|
||||
diskcache==5.6.3
|
||||
modelscope==1.34.0
|
||||
typer-slim==0.21.2
|
||||
tensorboard==2.20.0
|
||||
setuptools==71.1.0
|
||||
matplotlib>=3.7.5,<4
|
||||
toml==0.10.2
|
||||
fastapi>=0.110,<1
|
||||
uvicorn>=0.27,<1
|
||||
@@ -0,0 +1,6 @@
|
||||
FROM python:3.12-slim@sha256:78387bc3881b8273120a12ebe6c1ab22b018ccc2c9adf565ae1ac9b536e184ea
|
||||
WORKDIR /ui
|
||||
COPY app.py index.html /ui/
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
|
||||
USER 65534:65534
|
||||
ENTRYPOINT ["python3", "/ui/app.py"]
|
||||
@@ -0,0 +1,69 @@
|
||||
"""ACE-Step Studio UI; Deck owns execution, GPU coordination and resident weights."""
|
||||
import json,threading,time,urllib.request,urllib.error,uuid
|
||||
from pathlib import Path
|
||||
from http.server import BaseHTTPRequestHandler,ThreadingHTTPServer
|
||||
CONFIG=Path('/data/deck-connection.json');ROOT=Path('/data/results');LOCK=threading.RLock();JOB=None
|
||||
|
||||
def request(path,data=None,connection=None):
|
||||
c=connection or json.loads(CONFIG.read_text())
|
||||
req=urllib.request.Request(c.get('base_url','http://127.0.0.1:8120')+path,data=None if data is None else json.dumps(data).encode(),headers={'Authorization':'Bearer '+c['token'],'Content-Type':'application/json'})
|
||||
try:
|
||||
with urllib.request.urlopen(req,timeout=1850) as response:return response.read(256*1024**2+1)
|
||||
except urllib.error.HTTPError as exc:
|
||||
try:message=json.load(exc).get('error',{}).get('message','Deck-Anfrage abgelehnt.')
|
||||
except Exception:message='Deck-Anfrage abgelehnt.'
|
||||
raise ValueError(message) from None
|
||||
|
||||
def generate(ident,data):
|
||||
global JOB
|
||||
try:
|
||||
c=json.loads(CONFIG.read_text());data['model']=c['model'];audio=request('/v1/audio/music',data)
|
||||
if len(audio)>256*1024**2:raise ValueError('Audioausgabe zu groß.')
|
||||
ROOT.mkdir(parents=True,exist_ok=True);(ROOT/(ident+'.wav')).write_bytes(audio)
|
||||
with LOCK:JOB.update(state='complete',phase='Musik fertig · ACE-Step bleibt in Deck geladen')
|
||||
except Exception as exc:
|
||||
with LOCK:JOB.update(state='failed',phase=str(exc) if isinstance(exc,ValueError) else 'Deck-Verbindung prüfen.')
|
||||
|
||||
class Handler(BaseHTTPRequestHandler):
|
||||
def log_message(self,*args):pass
|
||||
def send(self,data,status=200,mime='application/json'):
|
||||
raw=data if isinstance(data,bytes) else json.dumps(data).encode();self.send_response(status);self.send_header('Content-Type',mime);self.send_header('Content-Length',str(len(raw)));self.send_header('Cache-Control','no-store');self.send_header('X-Content-Type-Options','nosniff');self.end_headers();self.wfile.write(raw)
|
||||
def do_GET(self):
|
||||
if self.path=='/':return self.send(Path('/ui/index.html').read_bytes(),mime='text/html; charset=utf-8')
|
||||
if self.path=='/api/status':return self.send(dict(configured=CONFIG.exists(),job=JOB))
|
||||
if self.path.startswith('/audio/'):
|
||||
ident=self.path[7:]
|
||||
if len(ident)!=32 or any(c not in '0123456789abcdef' for c in ident):return self.send({'error':'Ungültige ID'},400)
|
||||
path=ROOT/(ident+'.wav')
|
||||
if not path.is_file():return self.send({'error':'Noch kein Ergebnis'},404)
|
||||
return self.send(path.read_bytes(),mime='audio/wav')
|
||||
return self.send({'error':'Nicht gefunden'},404)
|
||||
def do_POST(self):
|
||||
global JOB
|
||||
# Browser mutations must come from this page; credentials never return to UI.
|
||||
origin=self.headers.get('Origin')
|
||||
if origin and origin.split('://',1)[-1]!=self.headers.get('Host'):return self.send({'error':'Fremder Ursprung'},403)
|
||||
if self.headers.get('X-Athena-Studio')!='1':return self.send({'error':'Same-origin control required'},403)
|
||||
try:
|
||||
length=int(self.headers.get('Content-Length','0'))
|
||||
if not 1<=length<=65536:raise ValueError('Ungültige Anfragegröße.')
|
||||
data=json.loads(self.rfile.read(length))
|
||||
if not isinstance(data,dict):raise ValueError('JSON-Objekt erwartet.')
|
||||
if self.path=='/api/connection':
|
||||
if set(data)!={'token','model'} or not isinstance(data['token'],str) or not 1<=len(data['token'])<=512 or not isinstance(data['model'],str):raise ValueError('Token und API-ID erwartet.')
|
||||
models=json.loads(request('/v1/audio/music/models',connection=data))['data']
|
||||
if data['model'] not in [m['id'] for m in models]:raise ValueError('Musikprofil in Deck freigeben und API-ID prüfen.')
|
||||
CONFIG.parent.mkdir(parents=True,exist_ok=True);temp=CONFIG.with_suffix('.tmp');temp.write_text(json.dumps(data));temp.chmod(0o600);temp.replace(CONFIG)
|
||||
return self.send({'ok':True})
|
||||
if self.path=='/api/generate':
|
||||
if set(data)-{'lyrics','style','duration_seconds','seed','steps','guidance','thinking','instrumental','bpm','language'}:raise ValueError('Unbekannte Musikparameter.')
|
||||
if not CONFIG.exists():raise ValueError('Zuerst Deck-Verbindung einrichten.')
|
||||
with LOCK:
|
||||
if JOB and JOB['state']=='running':raise ValueError('Musikauftrag läuft bereits.')
|
||||
ident=uuid.uuid4().hex;JOB=dict(id=ident,state='running',phase='Deck lädt ACE-Step und erzeugt Musik',started_at=time.time())
|
||||
threading.Thread(target=generate,args=(ident,data),daemon=True).start()
|
||||
return self.send({'id':ident})
|
||||
return self.send({'error':'Nicht gefunden'},404)
|
||||
except ValueError as exc:return self.send({'error':str(exc)[:512]},400)
|
||||
except (OSError,KeyError):return self.send({'error':'Deck-Verbindung prüfen.'},400)
|
||||
if __name__=='__main__':ThreadingHTTPServer(('127.0.0.1',8131),Handler).serve_forever()
|
||||
@@ -0,0 +1,7 @@
|
||||
<!doctype html><html lang="de"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>ACE-Step Studio</title><style>body{font:16px system-ui;background:#111820;color:#e1ebf1;max-width:900px;margin:30px auto;padding:20px}section{background:#1b2630;padding:24px;border-radius:14px;margin:20px 0}label{display:block;margin:14px 0}input:not([type=checkbox]),textarea{display:block;box-sizing:border-box;width:100%;background:#0e151c;color:inherit;border:1px solid #52717e;border-radius:6px;padding:10px;font:inherit}button{background:#60d1ea;border:0;border-radius:8px;padding:12px 24px;font:inherit;cursor:pointer}button:disabled{opacity:.5}a{color:#60d1ea}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:16px}audio{width:100%}</style><h1>ACE-Step Studio</h1><p>XL-SFT · 1.7B-Musik-Sprachmodell · Ausführung über Athena Deck</p><section><p id="state" role="status"></p><form id="song"><label>Musikstil<textarea id="style" required maxlength="2000" rows="3" placeholder="Acoustic country, warm male vocals, close harmonies, gentle guitar"></textarea></label><label>Songtext<textarea id="lyrics" maxlength="8000" rows="7" placeholder="[Verse] … [Chorus] …"></textarea></label><label><input id="instrumental" type="checkbox"> Instrumental ohne Gesang</label><div class="grid"><label>Dauer (Sekunden)<input id="duration" type="number" min="10" max="600" value="30" required></label><label>Diffusionsschritte<input id="steps" type="number" min="1" max="200" value="50" required></label><label>Guidance<input id="guidance" type="number" min="0" max="20" step=".1" value="7" required></label><label>Seed<input id="seed" type="number" min="0" max="2147483647" value="1234" required></label><label>Gesangssprache<input id="language" value="unknown" maxlength="16"></label><label>BPM (optional)<input id="bpm" type="number" min="30" max="300"></label></div><label><input id="thinking" type="checkbox" checked> Musik-Sprachmodell verwenden (Thinking)</label><button id="start">Musik erzeugen</button></form><p id="error" role="alert"></p><div id="result"></div><p>In Deck zuerst Musik starten und dieses Profil freigeben. Modellwechsel und Abbrechen erfolgen in Deck. Erfolgreiche Songs entladen die Gewichte nicht.</p></section><details><summary>Deck-Verbindung</summary><section><form id="connection"><label>Deck API-Token<input id="token" type="password" autocomplete="off" required></label><label>API-ID des ACE-Step-Profils<input id="model" value="ace-step-xl-sft" required></label><button>Prüfen & speichern</button></form><p id="connection-state"></p></section></details><script>
|
||||
const el=id=>document.getElementById(id);let resultId=null;
|
||||
async function api(path,data){const r=await fetch('/api/'+path,data===undefined?{}:{method:'POST',headers:{'Content-Type':'application/json','X-Athena-Studio':'1'},body:JSON.stringify(data)});const d=await r.json();if(!r.ok)throw Error(d.error);return d;}
|
||||
el('song').onsubmit=async event=>{event.preventDefault();el('error').textContent='';el('start').disabled=true;try{await api('generate',{style:el('style').value,lyrics:el('lyrics').value,instrumental:el('instrumental').checked,duration_seconds:Number(el('duration').value),steps:Number(el('steps').value),guidance:Number(el('guidance').value),seed:Number(el('seed').value),thinking:el('thinking').checked,language:el('language').value,bpm:el('bpm').value?Number(el('bpm').value):null});}catch(e){el('error').textContent=e.message;el('start').disabled=false;}};
|
||||
el('connection').onsubmit=async event=>{event.preventDefault();try{await api('connection',{token:el('token').value,model:el('model').value});el('connection-state').textContent='Verbunden';el('token').value='';}catch(e){el('connection-state').textContent=e.message;}};
|
||||
async function poll(){try{const s=await api('status');el('state').textContent=s.job?.phase||(s.configured?'Bereit · Musik in Deck starten':'Deck-Verbindung einrichten');el('start').disabled=!s.configured||s.job?.state==='running';if(s.job?.state==='complete'&&resultId!==s.job.id){resultId=s.job.id;el('result').innerHTML='<h2>Ergebnis</h2><audio controls src="/audio/'+resultId+'"></audio><p><a download="ace-step.wav" href="/audio/'+resultId+'">WAV herunterladen</a></p>';}if(s.job?.state==='failed')el('error').textContent=s.job.phase;}catch(e){el('error').textContent=e.message;}setTimeout(poll,1500);}poll();
|
||||
</script></html>
|
||||
@@ -0,0 +1,19 @@
|
||||
"""Run only after stopping Deck; creates the prepared profile without changing mode."""
|
||||
import json,os,sys
|
||||
from pathlib import Path
|
||||
sys.path.insert(0,str(Path(__file__).resolve().parent.parent))
|
||||
from catalog import Catalog
|
||||
from profiles import Profiles
|
||||
from acestep_models import ACE_REPO,ACE_COMPONENTS
|
||||
|
||||
def activate(state):
|
||||
state=Path(state);plan=json.loads((state/'acestep-import-plan.json').read_text());catalog=Catalog(state/'models');profiles=Profiles(state/'profiles.json',catalog)
|
||||
main=plan[ACE_REPO+'/model-00001-of-00004.safetensors'];existing=next((p for p in profiles.rows if p.get('api_id')=='ace-step-xl-sft'),None)
|
||||
if existing and existing['model_id']!=main:raise ValueError('ACE-Step API-ID bereits anders verwendet.')
|
||||
row=existing or profiles.save(dict(id=None,revision=0,name='ACE-Step 1.5 XL-SFT',api_id='ace-step-xl-sft',kind='music',model_id=main,parameters={}))
|
||||
components={role:plan[info.get('repo',ACE_REPO)+'/'+info['files'][0]] for role,info in ACE_COMPONENTS.items()}
|
||||
if row.get('components')!=components:row=profiles.assign(dict(id=row['id'],revision=row['revision'],components=components))
|
||||
endpoint=state/'endpoint.json';config=json.loads(endpoint.read_text());config['enabled_profiles']=sorted(set(config['enabled_profiles'])|{row['id']});temp=endpoint.with_suffix('.tmp');temp.write_text(json.dumps(config));temp.replace(endpoint)
|
||||
for p in (state/'profiles.json',endpoint):os.chown(p,65534,65534)
|
||||
print(json.dumps(dict(profile=row['name'],api_id=row['api_id'],components=len(components),mode_unchanged=True)))
|
||||
if __name__=='__main__':activate(sys.argv[1])
|
||||
@@ -53,7 +53,7 @@ def export(manager):
|
||||
try:relative=str(Path(source).relative_to(deck))
|
||||
except ValueError:pass
|
||||
mounts.append(dict(index=i,target=m['Destination'],read_only=not m['RW'],deck_path=relative,files=config_files(source,m['Destination']),was_file=Path(source).is_file()))
|
||||
result.append(dict(name=row['name'],image=c['Image'],registry=registry,application=c.get('Labels',{}).get(APP,''),labels={k:v for k,v in (c.get('Labels') or {}).items() if k.startswith('io.athena-deck.')},env=c.get('Env') or [],entrypoint=c.get('Entrypoint'),cmd=c.get('Cmd'),uid=app_uid(row['id'],c.get('User') or ''),user=c.get('User') or '',workdir=c.get('WorkingDir') or '',network=h['NetworkMode'],ports=h.get('PortBindings') or {},restart=h.get('RestartPolicy',{}).get('Name') or 'no',memory=h.get('Memory') or 0,nanocpus=h.get('NanoCpus') or 0,running=x['State']['Running'],mounts=mounts,build_recipe='swarm-ui' if row['name']=='athena-swarm-ui' else 'ladypoly' if row['name']=='athena-ladypoly' else 'separator-web' if row['name']=='athena-separator-web' else 'voice-web' if row['name'] in ('athena-voxcpm2-web','athena-omnivoice-web') else None,unsupported=bool(h.get('Privileged') or h.get('DeviceRequests') or h.get('Devices') or h.get('CapAdd'))))
|
||||
result.append(dict(name=row['name'],image=c['Image'],registry=registry,application=c.get('Labels',{}).get(APP,''),labels={k:v for k,v in (c.get('Labels') or {}).items() if k.startswith('io.athena-deck.')},env=c.get('Env') or [],entrypoint=c.get('Entrypoint'),cmd=c.get('Cmd'),uid=app_uid(row['id'],c.get('User') or ''),user=c.get('User') or '',workdir=c.get('WorkingDir') or '',network=h['NetworkMode'],ports=h.get('PortBindings') or {},restart=h.get('RestartPolicy',{}).get('Name') or 'no',memory=h.get('Memory') or 0,nanocpus=h.get('NanoCpus') or 0,running=x['State']['Running'],mounts=mounts,build_recipe='swarm-ui' if row['name']=='athena-swarm-ui' else 'ladypoly' if row['name']=='athena-ladypoly' else 'separator-web' if row['name']=='athena-separator-web' else 'acestep-web' if row['name']=='athena-acestep-web' else 'voice-web' if row['name'] in ('athena-voxcpm2-web','athena-omnivoice-web') else None,unsupported=bool(h.get('Privileged') or h.get('DeviceRequests') or h.get('Devices') or h.get('CapAdd'))))
|
||||
return {'services':result,'configured':bool(deck)}
|
||||
|
||||
def validate(c):
|
||||
@@ -61,9 +61,9 @@ def validate(c):
|
||||
if any(c.get('labels',{}).get(k)!=v for k,v in LABELS.items()):raise ValueError('Nur ausdrücklich Deck zugeordnete Anwendungscontainer erlaubt.')
|
||||
if c.get('unsupported'):raise ValueError('GPU-/privilegierter Container benötigt manuelle Einrichtung.')
|
||||
if c.get('network') not in ('bridge','default','host'):raise ValueError('Benutzerdefiniertes Docker-Netzwerk benötigt manuelle Einrichtung.')
|
||||
if c.get('network')=='host' and c['name'] not in ('athena-swarm-ui','ltx-deskweb','athena-ladypoly','athena-separator-web','athena-voxcpm2-web','athena-omnivoice-web'):raise ValueError('Host-Netzwerk nur für bekannte Deck-Oberflächen erlaubt.')
|
||||
recipes={'separator-web':('athena-separator-web','athena-separator-web:0.1.0'),'swarm-ui':('athena-swarm-ui','athena-swarm-ui:de7b834'),'ladypoly':('athena-ladypoly','athena-ladypoly:3960afc-deck1')}
|
||||
if c.get('build_recipe')=='voice-web' and c['name'] in ('athena-voxcpm2-web','athena-omnivoice-web') and c.get('image')=='athena-voice-web:0.2.1-deck1':pass
|
||||
if c.get('network')=='host' and c['name'] not in ('athena-swarm-ui','ltx-deskweb','athena-ladypoly','athena-separator-web','athena-voxcpm2-web','athena-omnivoice-web','athena-acestep-web'):raise ValueError('Host-Netzwerk nur für bekannte Deck-Oberflächen erlaubt.')
|
||||
recipes={'acestep-web':('athena-acestep-web','athena-acestep-web:1.0.0'),'separator-web':('athena-separator-web','athena-separator-web:0.1.0'),'swarm-ui':('athena-swarm-ui','athena-swarm-ui:de7b834'),'ladypoly':('athena-ladypoly','athena-ladypoly:3960afc-deck1')}
|
||||
if c.get('build_recipe')=='voice-web' and c['name'] in ('athena-voxcpm2-web','athena-omnivoice-web') and c.get('image') in ('athena-voice-web:0.2.1-deck1','athena-voice-web:0.2.1-deck2'):pass
|
||||
elif c.get('build_recipe') is not None and recipes.get(c['build_recipe'])!=(c['name'],c.get('image')):raise ValueError('Unbekanntes Build-Rezept.')
|
||||
ref=c.get('registry') or c.get('image','')
|
||||
if not isinstance(ref,str) or not re.fullmatch(r'[A-Za-z0-9][A-Za-z0-9._/@:-]{0,300}',ref):raise ValueError('Ungültige Image-Referenz.')
|
||||
@@ -98,7 +98,7 @@ def validate(c):
|
||||
if rel is not None and not native_media and (rel not in ('models','video/comfy-work/models','video/comfy-client-token') or not m['read_only']):raise ValueError('Deck-Volume nicht freigegeben; nur bekannte Modell-/Tokenpfade und LTX-Medienordner erlaubt.')
|
||||
for name,data in m.get('files',{}).items():
|
||||
allowed=('file','Settings.fds','Backends.fds')
|
||||
if c['name'] in ('athena-ladypoly','athena-separator-web','athena-voxcpm2-web','athena-omnivoice-web') and m['target']=='/data':allowed+=('settings.json','deck-connection.json')
|
||||
if c['name'] in ('athena-ladypoly','athena-separator-web','athena-voxcpm2-web','athena-omnivoice-web','athena-acestep-web') and m['target']=='/data':allowed+=('settings.json','deck-connection.json')
|
||||
if name not in allowed:raise ValueError('Unbekannte Konfigurationsdatei.')
|
||||
if not isinstance(data,str) or len(base64.b64decode(data,validate=True))>MAX_FILE:raise ValueError('Ungültige Konfigurationsdatei.')
|
||||
return c
|
||||
@@ -116,9 +116,9 @@ def restore(manager,c):
|
||||
# Never replace or restart an existing service during a restore.
|
||||
if x['Config']['Image'] not in (c['image'],c.get('registry')):raise ValueError('Vorhandener Container verwendet ein anderes Image; manuell prüfen.')
|
||||
return {'state':'reused','message':'Vorhandener markierter Container unverändert übernommen.'}
|
||||
if c['name'] in ('athena-ladypoly','athena-separator-web','athena-voxcpm2-web','athena-omnivoice-web'):
|
||||
with socket.socket() as probe:probe.bind(('127.0.0.1',{'athena-ladypoly':8127,'athena-separator-web':8128,'athena-voxcpm2-web':8129,'athena-omnivoice-web':8130}[c['name']]))
|
||||
if c.get('build_recipe') in ('swarm-ui','ladypoly','separator-web','voice-web'):
|
||||
if c['name'] in ('athena-ladypoly','athena-separator-web','athena-voxcpm2-web','athena-omnivoice-web','athena-acestep-web'):
|
||||
with socket.socket() as probe:probe.bind(('127.0.0.1',{'athena-ladypoly':8127,'athena-separator-web':8128,'athena-voxcpm2-web':8129,'athena-omnivoice-web':8130,'athena-acestep-web':8131}[c['name']]))
|
||||
if c.get('build_recipe') in ('swarm-ui','ladypoly','separator-web','voice-web','acestep-web'):
|
||||
source=Path(__file__).parent/c['build_recipe']
|
||||
if not (source/'Dockerfile').is_file():raise ValueError('Gepinntes Swarm-Build-Rezept fehlt im Systemhelfer.')
|
||||
if c['build_recipe']=='voice-web':
|
||||
@@ -146,7 +146,7 @@ def restore(manager,c):
|
||||
if base.is_symlink():raise ValueError('Unsicheres Dienstverzeichnis.')
|
||||
base.mkdir(parents=True,exist_ok=True,mode=0o700)
|
||||
args=['create','--name',name,'--network',c['network'],'--restart',c['restart'],'--cap-drop','ALL','--security-opt','no-new-privileges:true','--pids-limit','256']
|
||||
if c['name'] in ('athena-ladypoly','athena-separator-web','athena-voxcpm2-web','athena-omnivoice-web'):
|
||||
if c['name'] in ('athena-ladypoly','athena-separator-web','athena-voxcpm2-web','athena-omnivoice-web','athena-acestep-web'):
|
||||
args+=['--read-only','--tmpfs','/tmp:rw,noexec,nosuid,size='+('1g' if c['name']=='athena-separator-web' else '128m')+',uid=65534,gid=65534']
|
||||
if c['memory']:args+=['--memory',str(c['memory'])]
|
||||
if c['nanocpus']:args+=['--cpus',str(c['nanocpus']/1e9)]
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
"""Import the former router's ACE-Step files with verified, restorable Hub origins.
|
||||
Copies only recipe files; does not change profiles, endpoints or running processes.
|
||||
"""
|
||||
import hashlib,json,os,shutil,time,urllib.request
|
||||
from pathlib import Path
|
||||
from acestep_models import ACE_REPO,ACE_BASE_REPO,ACE_BASE_REVISION,ACE_FILES,ACE_BASE_FILES
|
||||
|
||||
def run(old,library,plan):
|
||||
old=Path(old);library=Path(library);result={};sources={}
|
||||
files=[(ACE_REPO,'acestep-v15-xl-sft',name) for name in ['model-00001-of-00004.safetensors',*ACE_FILES]]+[(ACE_BASE_REPO,'',name) for name in ACE_BASE_FILES]
|
||||
for repo,folder,name in files:
|
||||
base=old/folder;source=base/name;meta=base/'.cache/huggingface/download'/(name+'.metadata')
|
||||
revision=meta.read_text().splitlines()[0]
|
||||
if repo==ACE_BASE_REPO and revision!=ACE_BASE_REVISION:raise ValueError('Unexpected base package revision')
|
||||
key=(repo,revision)
|
||||
if key not in sources:
|
||||
with urllib.request.urlopen('https://huggingface.co/api/models/'+repo+'/revision/'+revision+'?blobs=true',timeout=30) as response:data=json.load(response)
|
||||
if data['sha']!=revision:raise ValueError('Revision verification failed')
|
||||
sources[key]={f['rfilename']:f for f in data['siblings']}
|
||||
upstream=sources[key][name]
|
||||
size=upstream.get('size',upstream.get('lfs',{}).get('size'))
|
||||
if name.endswith('.py') and source.stat().st_size!=size:
|
||||
# Old ACE auto-sync modified its local model code. Import the original
|
||||
# small code file from the pinned Hub revision, leaving the old tree alone.
|
||||
cache=Path(plan).parent/'acestep-source-files'/revision/name;cache.parent.mkdir(parents=True,exist_ok=True)
|
||||
with urllib.request.urlopen('https://huggingface.co/'+repo+'/resolve/'+revision+'/'+name,timeout=30) as response:cache.write_bytes(response.read(2*1024**2))
|
||||
source=cache
|
||||
if source.stat().st_size!=size:raise ValueError('Source size mismatch: '+name)
|
||||
digest=hashlib.sha256();git_digest=hashlib.sha1();git_digest.update(('blob '+str(source.stat().st_size)+'\0').encode())
|
||||
with source.open('rb') as stream:
|
||||
while chunk:=stream.read(8*1024**2):digest.update(chunk);git_digest.update(chunk)
|
||||
sha=digest.hexdigest()
|
||||
if upstream.get('lfs'):
|
||||
if sha!=upstream['lfs']['sha256']:raise ValueError('Source SHA-256 mismatch: '+name)
|
||||
elif git_digest.hexdigest()!=upstream['blobId']:raise ValueError('Source Git hash mismatch: '+name)
|
||||
ident=hashlib.sha256((repo+revision+name).encode()).hexdigest();target=library/ident;target.mkdir(parents=True,exist_ok=True)
|
||||
dest=target/('model'+Path(name).suffix)
|
||||
if not dest.exists():
|
||||
partial=dest.with_suffix(dest.suffix+'.partial');shutil.copyfile(source,partial);partial.replace(dest)
|
||||
if dest.stat().st_size!=source.stat().st_size:raise ValueError('Imported size mismatch')
|
||||
check=hashlib.sha256()
|
||||
with dest.open('rb') as stream:
|
||||
while chunk:=stream.read(8*1024**2):check.update(chunk)
|
||||
if check.hexdigest()!=sha:raise ValueError('Imported checksum mismatch')
|
||||
entry=dict(repo=repo,revision=revision,file=name,size=dest.stat().st_size,sha256=sha,upstream_hash_verified=True,kind='music',downloaded_at=time.time(),state='downloaded',runtime_ready=False,runtime_metadata=dict(pipeline_tag='text-to-audio',library_name='diffusers',architecture='acestep',tags=['license:mit']))
|
||||
(target/'entry.tmp').write_text(json.dumps(entry));(target/'entry.tmp').replace(target/'entry.json')
|
||||
for item in (dest,target/'entry.json',target):os.chown(item,65534,65534)
|
||||
result[repo+'/'+name]=ident;print('Verified:',repo+'/'+name,flush=True)
|
||||
Path(plan).write_text(json.dumps(result));print('Complete:',len(result),'verified files',flush=True)
|
||||
if __name__=='__main__':
|
||||
import sys;run(*sys.argv[1:])
|
||||
+2
-2
@@ -14,7 +14,7 @@ import urllib.request
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
LABEL = 'de.casaderoll.athena-deck.standalone'
|
||||
FILES = ['deploy/omnivoice-requirements.lock','omnivoice_runtime.py','omnivoice_worker.py','deploy/voice-web/Dockerfile','deploy/voice-web/base.Dockerfile','deploy/voice-web/bridge.py','deploy/patch_yue2_residency.py','embeddings.py','voxcpm_test.py','voxcpm_worker.py','voice-ui.js','voxcpm_runtime.py','voxcpm-ui.js','deploy/voxcpm-requirements.lock','network/native.py','deploy/setup_network_helper.py','separator_sources.json','deploy/separator-web/Dockerfile','deploy/separator-web/app.py','deploy/separator-web/index.html','separator.py','separator_runtime.py','separator_worker.py','separator-ui.js','deploy/ladypoly/Dockerfile','deploy/ladypoly/bridge.py','music.py','music-ui.js','audio_cpp_runtime.py','audio-cpp-ui.js','ltx_original_runtime.py','ltx_original_entry.py','video_original.py','ltx-original-ui.js','deploy/ltx-original-requirements.lock','backup.py','backup_codec.py','backup-ui.js','deploy/docker_backup.py','deploy/swarm-ui/Dockerfile','deploy/swarm-ui/patch-source.py','deploy/swarm-ui/proxy.py','deploy/swarm-ui/entrypoint.py','deploy/Dockerfile.app-update','video_comfy.py','video_comfy_node.py','video_comfy_proxy.py','prompt_enhancer.py','prompt_enhancer_worker.py','image_upload.py','audio_policy.py','deploy/tts-requirements.lock','stt.py','stt-ui.js','api_compat.py','responses_compat.py','execution_setup.py','tts_runtime.py','tts_test.py','tts_worker.py','tts-ui.js','auto_test.py','auto-test-ui.js','chat_test.py','chat-test-ui.js','endpoint.py','inference.py','endpoint-ui.js','docker_support.py','docker-ui.js','deploy/docker_helper.py','deploy/setup_docker_helper.py','image_encoder_node.py','image_runtime.py','image_test.py','image-test-ui.js','profiles.py','profiles-ui.js','capacity.py','runtime.py','runtime-ui.js','video.py','video_proxy.py','video-ui.js','catalog.py','hub_auth.py','catalog-ui.js','server.py','auth.py','collect_hardware.py','dashboard_data.py','dashboard_history.py','dashboard-ui.js','dashboard.css','themes.css','deploy/import_dashboard_history.py','index.html','app.js','studio.js','style.css','login.html','login.js','access-ui.js','network-ui.js','network/__init__.py','network/client.py','network/config.py','network/rpc.py','deploy/Dockerfile','deploy/image-requirements.lock']
|
||||
FILES = ['deploy/activate_acestep.py','acestep_models.py','deploy/import_acestep.py','deploy/acestep-web/Dockerfile','deploy/acestep-web/app.py','deploy/acestep-web/index.html','acestep.py','acestep_worker.py','acestep_runtime.py','acestep-ui.js','deploy/acestep-requirements.lock','deploy/omnivoice-requirements.lock','omnivoice_runtime.py','omnivoice_worker.py','deploy/voice-web/Dockerfile','deploy/voice-web/base.Dockerfile','deploy/voice-web/bridge.py','deploy/patch_yue2_residency.py','embeddings.py','voxcpm_test.py','voxcpm_worker.py','voice-ui.js','voxcpm_runtime.py','voxcpm-ui.js','deploy/voxcpm-requirements.lock','network/native.py','deploy/setup_network_helper.py','separator_sources.json','deploy/separator-web/Dockerfile','deploy/separator-web/app.py','deploy/separator-web/index.html','separator.py','separator_runtime.py','separator_worker.py','separator-ui.js','deploy/ladypoly/Dockerfile','deploy/ladypoly/bridge.py','music.py','music-ui.js','audio_cpp_runtime.py','audio-cpp-ui.js','ltx_original_runtime.py','ltx_original_entry.py','video_original.py','ltx-original-ui.js','deploy/ltx-original-requirements.lock','backup.py','backup_codec.py','backup-ui.js','deploy/docker_backup.py','deploy/swarm-ui/Dockerfile','deploy/swarm-ui/patch-source.py','deploy/swarm-ui/proxy.py','deploy/swarm-ui/entrypoint.py','deploy/Dockerfile.app-update','video_comfy.py','video_comfy_node.py','video_comfy_proxy.py','prompt_enhancer.py','prompt_enhancer_worker.py','image_upload.py','audio_policy.py','deploy/tts-requirements.lock','stt.py','stt-ui.js','api_compat.py','responses_compat.py','execution_setup.py','tts_runtime.py','tts_test.py','tts_worker.py','tts-ui.js','auto_test.py','auto-test-ui.js','chat_test.py','chat-test-ui.js','endpoint.py','inference.py','endpoint-ui.js','docker_support.py','docker-ui.js','deploy/docker_helper.py','deploy/setup_docker_helper.py','image_encoder_node.py','image_runtime.py','image_test.py','image-test-ui.js','profiles.py','profiles-ui.js','capacity.py','runtime.py','runtime-ui.js','video.py','video_proxy.py','video-ui.js','catalog.py','hub_auth.py','catalog-ui.js','server.py','auth.py','collect_hardware.py','dashboard_data.py','dashboard_history.py','dashboard-ui.js','dashboard.css','themes.css','deploy/import_dashboard_history.py','index.html','app.js','studio.js','style.css','login.html','login.js','access-ui.js','network-ui.js','network/__init__.py','network/client.py','network/config.py','network/rpc.py','deploy/Dockerfile','deploy/image-requirements.lock']
|
||||
|
||||
|
||||
def run(*args, check=True, interactive=False):
|
||||
@@ -206,7 +206,7 @@ def update(base, rollback=False, force=False, api_ports=None, reuse_runtime=Fals
|
||||
backup_name=config['name']+'-previous'
|
||||
if inspect(backup_name):raise RuntimeError('Rückfall-Containername belegt. Keine Änderung ausgeführt.')
|
||||
stamp=str(time.time_ns())
|
||||
shutil.copytree(base/'state',base/'backups'/stamp,ignore=shutil.ignore_patterns('music-verification','music-test-temp','music-jobs','separator-runtime','separator-tests','voxcpm-runtime','omnivoice-runtime','voice-worker-check','voice-integration-check','voice-setup-code','audio-cpp-runtime','ltx-original-runtime','original-work','tts-runtime','tts-tests','voice-tests','models','runtime','runtime-verification','image-tests','image-verification','image-verification-*','image-runtime','video-runtime','video-verification','video-verification-*','comfy-work','router-verification-*'))
|
||||
shutil.copytree(base/'state',base/'backups'/stamp,ignore=shutil.ignore_patterns('acestep-runtime','acestep-jobs','acestep-setup-code','acestep-checkout','acestep-source-files','acestep-test-tmp','music-verification','music-test-temp','music-jobs','separator-runtime','separator-tests','voxcpm-runtime','omnivoice-runtime','voice-worker-check','voice-integration-check','voice-setup-code','audio-cpp-runtime','ltx-original-runtime','original-work','tts-runtime','tts-tests','voice-tests','models','runtime','runtime-verification','image-tests','image-verification','image-verification-*','image-runtime','video-runtime','video-verification','video-verification-*','comfy-work','router-verification-*'))
|
||||
was_running=previous['State']['Running']
|
||||
if was_running:run('docker','stop','--time','15',config['name'])
|
||||
run('docker','rename',config['name'],backup_name)
|
||||
|
||||
@@ -31,6 +31,9 @@ def main():
|
||||
(base/'separator-web').mkdir(exist_ok=True)
|
||||
for name in ('Dockerfile','app.py','index.html'):
|
||||
shutil.copyfile(Path(__file__).parent/'separator-web'/name,base/'separator-web'/name)
|
||||
(base/'acestep-web').mkdir(exist_ok=True)
|
||||
for name in ('Dockerfile','app.py','index.html'):
|
||||
shutil.copyfile(Path(__file__).parent/'acestep-web'/name,base/'acestep-web'/name)
|
||||
(base/'voice-web').mkdir(exist_ok=True)
|
||||
for name in ('Dockerfile','base.Dockerfile','bridge.py'):
|
||||
shutil.copyfile(Path(__file__).parent/'voice-web'/name,base/'voice-web'/name)
|
||||
|
||||
@@ -3,6 +3,7 @@ window.DockerUI=(()=>{
|
||||
const apps={
|
||||
'athena-voxcpm2-web':{title:'VoxCPM2 Studio',description:'Stimme erzeugen, gestalten und klonen; Ausführung über Decks Stimmworker.',port:8129,hint:'VoxCPM2-Profil in Deck aktivieren und Stimmwerkzeuge starten.'},
|
||||
'athena-omnivoice-web':{title:'OmniVoice Studio',description:'Bisherige OmniVoice-Weboberfläche; GPU-Aufträge laufen über Deck.',port:8130,hint:'OmniVoice-Profil in Deck aktivieren und Stimmwerkzeuge starten. Beim Klonen Referenztranskript eingeben.'},
|
||||
'athena-acestep-web':{title:'ACE-Step Studio',description:'Musik und Songs mit ACE-Step XL-SFT und dem 1.7B-Musik-Sprachmodell; Ausführung und Gewichte in Deck.',port:8131,hint:'ACE-Step-Profil freigeben und in der Steuerung Musik starten.'},
|
||||
'athena-ladypoly':{title:'LadyPoly YuE2',description:'Weboberfläche für Decks Musiklaufzeit.',port:8127,hint:'In der Steuerung Musik starten. Deck-Verbindung in LadyPoly einrichten.'},
|
||||
'athena-separator-web':{title:'Athena Separator Web',description:'Gesang oder Instrumente herauslösen; Verarbeitung durch Decks native Audio-Separator-Laufzeit.',port:8128,hint:'In der Steuerung Audio-Trennung starten. Modelle unter Audio-Trennung einrichten.'},
|
||||
'ltx-deskweb':{title:'LTX DeskWEB',description:'LTX-Webstudio für Videoerzeugung über Decks originale LTX-Laufzeit.',port:8118,hint:'Videoprofil freigeben und in der Steuerung Video starten.'},
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ window.EndpointUI=(()=>{
|
||||
const reason=available?'':selected==='video'?'Wähle zuerst ein eingerichtetes Videomodell.':selected==='separator'?'Installiere zuerst die Laufzeit und ein Trennmodellpaket.':'Gib zuerst ein ausführbares Profil am API-Endpunkt frei.';
|
||||
const state=switching?'Wechsel läuft':loading?'Modell wird geladen':ready?'Bereit':current&&s.state==='stopping'?'Wird gestoppt':current&&s.reachable?'Startet':current?'Gestoppt':'Nicht aktiv';
|
||||
put(root.querySelector('#control-modes'),`<div class="control-modes" role="tablist" aria-label="Betriebsart">${Object.entries(modeLabels).map(([id,name])=>`<button role="tab" aria-selected="${selected===id}" data-control-mode="${id}" class="${selected===id?'chosen':'secondary'}" ${busy?'disabled':''}>${name}</button>`).join('')}</div>`);
|
||||
put(root.querySelector('#endpoint-summary'),`<section class="card control-card" role="tabpanel"><div class="control-heading"><h2>${label}</h2><span class="pill">${e(state)}</span></div><p>${active==='switching'?`Wechsel zu ${e(modeLabels[v.target_mode]||v.target_mode)}`:(s.reachable||active==='separator')?`Aktiver Betrieb: ${e(modeLabels[active]||active)}`:'Betrieb gestoppt'}</p><div class="card-actions"><button data-control-start ${busy||!available||ready?'disabled':''}>${label} starten</button><button data-control-stop class="secondary" ${busy||!current||(s.state==='stopped'&&active==='llm')?'disabled':''}>Stoppen</button></div>${switching||loading||pending||s.state==='stopping'?`<div class="video-activity" role="status" aria-live="polite"><strong>${e(switching?v.switch_phase:loading?s.worker.phase||'Modell wird geladen':s.state==='stopping'?'Laufende Aufträge werden beendet':'Start wird angefordert')}</strong><progress aria-label="Fortschritt"></progress></div>`:''}${reason?`<p class="warning">${e(reason)} <a class="link" href="#${selected==='video'?'video':selected==='music'?'music':selected==='separator'?'separation':selected==='voice'?'voice':'chat'}">Einrichten →</a></p>`:''}${(current&&(v.error||s.error||selected==='llm'&&s.worker.error))?`<p class="video-error" role="alert">${e(v.error||s.error||s.worker.error)}</p>`:''}<div class="control-api"><h3>API-Adresse</h3>${routes.map(([name,url])=>`<div><span>${name}</span><code>${e(url)}</code></div>`).join('')}<p class="small">${ready?'Erreichbar':'Erreichbar, sobald dieser Betrieb bereit ist'} · Port ${selected==='separator'?8108:s.port}</p></div>${selected==='separator'?`<p class="small">${v.separator?.models?.filter(m=>m.installed).length||0} Modellpakete bereit · Gewichte laden beim Trennauftrag und werden anschließend entladen.</p><a class="link" href="${e(DeckLinks.url(8128,'/'))}" target="_blank" rel="noopener">Audio-Trennoberfläche öffnen →</a><p><a class="link" href="#separation">Modelle und Aufträge →</a></p>`:selected==='llm'?`<p class="small">${s.counts.llm.available} Chatprofile freigegeben · ${e(s.worker.profile_name||'Gewichte laden bei der ersten Anfrage')}</p>`:selected==='music'?`<p class="small">${e(v.music_profiles?.map(p=>p.name).join(', ')||'Kein Musikprofil freigegeben')} · Gewichte laden bei Anfrage</p>${available?`<a class="link" href="${e(DeckLinks.url(8127,'/'))}" target="_blank" rel="noopener">LadyPoly YuE2 öffnen →</a>${!ready?'<p class="small">Vor dem Generieren Musik starten.</p>':''}`:''}`:selected==='voice'?`<p class="small">${e(v.voice_profiles?.map(p=>p.name).join(', ')||'Kein Stimmprofil freigegeben')} · Gewichte laden beim Auftrag</p><p><a class="link" href="#voice-test">Stimme ausprobieren →</a></p><p><a class="link" href="${e(DeckLinks.url(8129,'/'))}" target="_blank" rel="noopener">VoxCPM2 Studio →</a> · <a class="link" href="${e(DeckLinks.url(8130,'/'))}" target="_blank" rel="noopener">OmniVoice Studio →</a></p>`:`<p class="small">${e(v.service?.name||'Kein Videomodell ausgewählt')} · ${v.runtime_kind==='original'?'LTX Original':'ComfyUI'} · Gewichte laden bei Generierung</p>${ready?`<a class="link" href="${e(v.runtime_kind==='original'?DeckLinks.url(8118,'/'):address+'/')}" target="_blank" rel="noopener">${v.runtime_kind==='original'?'LTX DeskWEB':'ComfyUI'} öffnen →</a>`:''}`}<details class="control-details"><summary>Weitere Dienste & Einstellungen</summary><p>Im LLM-Betrieb stehen auch freigegebene Bild-, TTS- und STT-Profile bereit.</p><p><a class="link" href="#endpoint">Endpunkt und Port einstellen →</a></p><p>${s.scheduler.active_requests} laufende · ${s.scheduler.waiting_requests} wartende Aufträge</p></details></section>`);
|
||||
put(root.querySelector('#endpoint-summary'),`<section class="card control-card" role="tabpanel"><div class="control-heading"><h2>${label}</h2><span class="pill">${e(state)}</span></div><p>${active==='switching'?`Wechsel zu ${e(modeLabels[v.target_mode]||v.target_mode)}`:(s.reachable||active==='separator')?`Aktiver Betrieb: ${e(modeLabels[active]||active)}`:'Betrieb gestoppt'}</p><div class="card-actions"><button data-control-start ${busy||!available||ready?'disabled':''}>${label} starten</button><button data-control-stop class="secondary" ${busy||!current||(s.state==='stopped'&&active==='llm')?'disabled':''}>Stoppen</button></div>${switching||loading||pending||s.state==='stopping'?`<div class="video-activity" role="status" aria-live="polite"><strong>${e(switching?v.switch_phase:loading?s.worker.phase||'Modell wird geladen':s.state==='stopping'?'Laufende Aufträge werden beendet':'Start wird angefordert')}</strong><progress aria-label="Fortschritt"></progress></div>`:''}${reason?`<p class="warning">${e(reason)} <a class="link" href="#${selected==='video'?'video':selected==='music'?'music':selected==='separator'?'separation':selected==='voice'?'voice':'chat'}">Einrichten →</a></p>`:''}${(current&&(v.error||s.error||selected==='llm'&&s.worker.error))?`<p class="video-error" role="alert">${e(v.error||s.error||s.worker.error)}</p>`:''}<div class="control-api"><h3>API-Adresse</h3>${routes.map(([name,url])=>`<div><span>${name}</span><code>${e(url)}</code></div>`).join('')}<p class="small">${ready?'Erreichbar':'Erreichbar, sobald dieser Betrieb bereit ist'} · Port ${selected==='separator'?8108:s.port}</p></div>${selected==='separator'?`<p class="small">${v.separator?.models?.filter(m=>m.installed).length||0} Modellpakete bereit · Gewichte laden beim Trennauftrag und werden anschließend entladen.</p><a class="link" href="${e(DeckLinks.url(8128,'/'))}" target="_blank" rel="noopener">Audio-Trennoberfläche öffnen →</a><p><a class="link" href="#separation">Modelle und Aufträge →</a></p>`:selected==='llm'?`<p class="small">${s.counts.llm.available} Chatprofile freigegeben · ${e(s.worker.profile_name||'Gewichte laden bei der ersten Anfrage')}</p>`:selected==='music'?`<p class="small">${e(v.music_profiles?.map(p=>p.name).join(', ')||'Kein Musikprofil freigegeben')} · Gewichte laden bei Anfrage</p>${available?`<a class="link" href="${e(DeckLinks.url(8127,'/'))}" target="_blank" rel="noopener">LadyPoly YuE2 öffnen →</a> · <a class="link" href="${e(DeckLinks.url(8131,'/'))}" target="_blank" rel="noopener">ACE-Step Studio öffnen →</a>${!ready?'<p class="small">Vor dem Generieren Musik starten.</p>':''}`:''}`:selected==='voice'?`<p class="small">${e(v.voice_profiles?.map(p=>p.name).join(', ')||'Kein Stimmprofil freigegeben')} · Gewichte laden beim Auftrag</p><p><a class="link" href="#voice-test">Stimme ausprobieren →</a></p><p><a class="link" href="${e(DeckLinks.url(8129,'/'))}" target="_blank" rel="noopener">VoxCPM2 Studio →</a> · <a class="link" href="${e(DeckLinks.url(8130,'/'))}" target="_blank" rel="noopener">OmniVoice Studio →</a></p>`:`<p class="small">${e(v.service?.name||'Kein Videomodell ausgewählt')} · ${v.runtime_kind==='original'?'LTX Original':'ComfyUI'} · Gewichte laden bei Generierung</p>${ready?`<a class="link" href="${e(v.runtime_kind==='original'?DeckLinks.url(8118,'/'):address+'/')}" target="_blank" rel="noopener">${v.runtime_kind==='original'?'LTX DeskWEB':'ComfyUI'} öffnen →</a>`:''}`}<details class="control-details"><summary>Weitere Dienste & Einstellungen</summary><p>Im LLM-Betrieb stehen auch freigegebene Bild-, TTS- und STT-Profile bereit.</p><p><a class="link" href="#endpoint">Endpunkt und Port einstellen →</a></p><p>${s.scheduler.active_requests} laufende · ${s.scheduler.waiting_requests} wartende Aufträge</p></details></section>`);
|
||||
root.querySelectorAll('[data-control-mode]').forEach(b=>b.onclick=()=>{selectedMode=b.dataset.controlMode;control(s,root);});
|
||||
root.querySelector('[data-control-start]').onclick=()=>controlAction('start',selected);
|
||||
root.querySelector('[data-control-stop]').onclick=()=>controlAction('stop',selected);
|
||||
|
||||
+2
-2
@@ -371,9 +371,9 @@ class APIHandler(BaseHTTPRequestHandler):
|
||||
def music_generation(self,ep,data):
|
||||
if ep.scheduler.gpu_mode!='music':raise APIError('Bitte in der Übersicht auf Musik umschalten.',503,'music_mode_required')
|
||||
if not ep.music:raise APIError('Musikworker nicht eingerichtet.',501)
|
||||
if set(data)-{'model','lyrics','style','seed','max_tokens','steps'}:raise APIError('Nicht unterstützte Musikfelder.')
|
||||
if set(data)-{'model','lyrics','style','seed','max_tokens','steps','duration_seconds','guidance','thinking','instrumental','bpm','language'}:raise APIError('Nicht unterstützte Musikfelder.')
|
||||
profile=ep.find_profile(data.get('model'),'music')
|
||||
try:job=ep.music.start(profile['id'],data.get('lyrics'),data.get('style'),seed=data.get('seed',1234),max_tokens=data.get('max_tokens',400),steps=data.get('steps',8),wait=True)
|
||||
try:job=ep.music.start(profile['id'],data.get('lyrics',''),data.get('style'),seed=data.get('seed',1234),max_tokens=data.get('max_tokens',400),steps=data.get('steps'),wait=True,**{k:data[k] for k in ('duration_seconds','guidance','thinking','instrumental','bpm','language') if k in data})
|
||||
except ValueError as exc:raise APIError(str(exc)) from None
|
||||
end=time.monotonic()+1850
|
||||
while time.monotonic()<end:
|
||||
|
||||
+7
-1
@@ -1,7 +1,7 @@
|
||||
"""Read-only, conservative mapping to Deck's maintained execution adapters."""
|
||||
from catalog import file_role
|
||||
from stt import supported as stt_supported
|
||||
from profiles import image_recipe, image_adapter, video_recipe, voice_recipe, omni_recipe
|
||||
from profiles import image_recipe, image_adapter, video_recipe, voice_recipe, omni_recipe, acestep_recipe
|
||||
from tts_runtime import REPO, REVISION
|
||||
|
||||
def _assess(model, installed, profile=None):
|
||||
@@ -77,6 +77,12 @@ def _assess_candidates(model, installed, profile=None):
|
||||
if profile:result.update(state='ready' if profile.get('runnable') else 'profile_incomplete',blockers=profile.get('blockers',[]),label='VoxCPM2 bereit' if profile.get('runnable') else 'VoxCPM2 einrichten')
|
||||
if result.get('runtime'):
|
||||
add('current',result['runtime'],kind,result['route'],'Vorhandene Deck-Zuordnung')
|
||||
if acestep_recipe(model):
|
||||
result.update(family='ACE-Step 1.5 XL-SFT',runtime='ACE-Step · Python/PyTorch',route='#acestep-runtime',installed=bool(installed.get('acestep')),state='setup',label='ACE-Step · Komponenten prüfen',message='Originale ACE-Step-Laufzeit mit dauerhaft geladenem Deck-Musikworker.',components=[x['label'] for x in acestep_recipe(model).values()])
|
||||
result['candidates']=[]
|
||||
add('acestep','ACE-Step · Python/PyTorch','acestep','#acestep-runtime','Offizielles XL-SFT-Paket mit 1.7B-Musik-Sprachmodell')
|
||||
if profile:result.update(state='ready' if profile.get('runnable') else 'profile_incomplete',blockers=profile.get('blockers',[]))
|
||||
return result
|
||||
if kind=='music' and repo=='audio-cpp/yue2-3b-gguf' and name.startswith('yue2-3b-') and name.endswith('.gguf'):
|
||||
result.update(family='YuE2',evidence='audio-cpp/Yue2-3B-GGUF · Hauptmodell',state='adapter_missing',label='YuE2 erkannt · Deck-Worker fehlt',message='Passende Laufzeit: audio.cpp. Sie kann einmalig heruntergeladen und gebaut werden. Zur Generierung fehlen noch der Deck-Musikworker und die Ladypoly-Anbindung. Installation allein schaltet dieses Modell nicht frei.',components=['YuE2-VAE GGUF','Modell-/Generierungskonfiguration, VAE-Konfiguration und Qwen-Tokenizer (sidecars)'])
|
||||
if installed.get('music_worker'):
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
<!doctype html><html lang="de"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Athena Deck</title><link rel="stylesheet" href="/style.css"><link rel="stylesheet" href="/dashboard.css"><link rel="stylesheet" href="/themes.css"><script src="/network-ui.js" defer></script><script src="/access-ui.js" defer></script><script src="/catalog-ui.js" defer></script><script src="/runtime-ui.js" defer></script><script src="/profiles-ui.js" defer></script><script src="/auto-test-ui.js" defer></script><script src="/chat-test-ui.js" defer></script><script src="/image-test-ui.js" defer></script><script src="/docker-ui.js" defer></script><script src="/stt-ui.js" defer></script><script src="/tts-ui.js" defer></script><script src="/voxcpm-ui.js" defer></script><script src="/voice-ui.js" defer></script><script src="/studio.js" defer></script><script src="/separator-ui.js" defer></script><script src="/music-ui.js" defer></script><script src="/audio-cpp-ui.js" defer></script><script src="/ltx-original-ui.js" defer></script><script src="/video-ui.js" defer></script><script src="/endpoint-ui.js" defer></script><script src="/dashboard-ui.js" defer></script><script src="/backup-ui.js" defer></script><script src="/app.js" defer></script></head><body><aside><a class="brand" href="#dashboard"><span>Α</span> ATHENA <b>DECK</b></a><p class="eyebrow">WORKSPACE / ATHENA</p><nav aria-label="Hauptnavigation"><p class="nav-heading">Übersicht</p><a href="#dashboard">Dashboard</a><a href="#home">Steuerung</a><p class="nav-heading">KI-Werkzeuge</p><a href="#chat">Chat & Sprachmodelle</a><a href="#embeddings">Embeddings</a><a href="#image">Bildgenerierung</a><a href="#music">Musikgenerierung</a><a href="#separation">Audio-Trennung</a><a href="#audio">Sprachausgabe (TTS)</a><a href="#stt">Spracherkennung (STT)</a><a href="#voice">Stimmwerkzeuge</a><a href="#video">Videogenerierung</a><p class="nav-heading">Anwendungen</p><a href="#services">Weitere Dienste</a><p class="nav-heading">Einstellungen</p><a href="#runtimes">Laufzeiten</a><a href="#endpoint">Endpunkt</a><a href="#network">Netzwerk</a><a href="#access">Zugang & API-Token</a><a href="#appearance">Darstellung</a><a href="#backup">Backup & Wiederherstellung</a></nav><footer><i></i> Isolierte Entwicklungsumgebung<p>Eigener Modell-Router<br>Hardware · nur lesend</p></footer></aside><main><header><span>ATHENA CONTROL SURFACE</span><span class="pill">v0.7 · Router</span></header><div id="view"></div><p id="error" role="alert"></p></main></body></html>
|
||||
<!doctype html><html lang="de"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Athena Deck</title><link rel="stylesheet" href="/style.css"><link rel="stylesheet" href="/dashboard.css"><link rel="stylesheet" href="/themes.css"><script src="/network-ui.js" defer></script><script src="/access-ui.js" defer></script><script src="/catalog-ui.js" defer></script><script src="/runtime-ui.js" defer></script><script src="/profiles-ui.js" defer></script><script src="/auto-test-ui.js" defer></script><script src="/chat-test-ui.js" defer></script><script src="/image-test-ui.js" defer></script><script src="/docker-ui.js" defer></script><script src="/stt-ui.js" defer></script><script src="/tts-ui.js" defer></script><script src="/voxcpm-ui.js" defer></script><script src="/voice-ui.js" defer></script><script src="/studio.js" defer></script><script src="/separator-ui.js" defer></script><script src="/music-ui.js" defer></script><script src="/acestep-ui.js" defer></script><script src="/audio-cpp-ui.js" defer></script><script src="/ltx-original-ui.js" defer></script><script src="/video-ui.js" defer></script><script src="/endpoint-ui.js" defer></script><script src="/dashboard-ui.js" defer></script><script src="/backup-ui.js" defer></script><script src="/app.js" defer></script></head><body><aside><a class="brand" href="#dashboard"><span>Α</span> ATHENA <b>DECK</b></a><p class="eyebrow">WORKSPACE / ATHENA</p><nav aria-label="Hauptnavigation"><p class="nav-heading">Übersicht</p><a href="#dashboard">Dashboard</a><a href="#home">Steuerung</a><p class="nav-heading">KI-Werkzeuge</p><a href="#chat">Chat & Sprachmodelle</a><a href="#embeddings">Embeddings</a><a href="#image">Bildgenerierung</a><a href="#music">Musikgenerierung</a><a href="#separation">Audio-Trennung</a><a href="#audio">Sprachausgabe (TTS)</a><a href="#stt">Spracherkennung (STT)</a><a href="#voice">Stimmwerkzeuge</a><a href="#video">Videogenerierung</a><p class="nav-heading">Anwendungen</p><a href="#services">Weitere Dienste</a><p class="nav-heading">Einstellungen</p><a href="#runtimes">Laufzeiten</a><a href="#endpoint">Endpunkt</a><a href="#network">Netzwerk</a><a href="#access">Zugang & API-Token</a><a href="#appearance">Darstellung</a><a href="#backup">Backup & Wiederherstellung</a></nav><footer><i></i> Isolierte Entwicklungsumgebung<p>Eigener Modell-Router<br>Hardware · nur lesend</p></footer></aside><main><header><span>ATHENA CONTROL SURFACE</span><span class="pill">v0.7 · Router</span></header><div id="view"></div><p id="error" role="alert"></p></main></body></html>
|
||||
+7
-5
@@ -1,12 +1,14 @@
|
||||
window.MusicUI=(()=>{
|
||||
const e=v=>String(v??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
|
||||
async function api(path,data){const r=await fetch('/api/v1/'+path,data===undefined?{}:{method:'POST',headers:{'Content-Type':'application/json','X-Athena-Deck':'1'},body:JSON.stringify(data)});const x=await r.json();if(!r.ok)throw Error(x.error||'Musikanfrage fehlgeschlagen');return x;}
|
||||
function html(){return '<section id="music-test" class="card"><h2>Musik ausprobieren</h2><p>YuE2 über audio.cpp. Englische Songtexte werden empfohlen. Die maximale Länge begrenzt den Test. YuE2 kann früher enden; eine exakt feste Titellänge ist damit nicht garantiert.</p><p id="music-state" role="status"></p><p id="music-error" role="alert"></p><div id="music-progress"></div><form id="music-form"><label>Profil<select id="music-profile" required></select></label><label>Musikstil<textarea id="music-style" maxlength="2000" required placeholder="English, acoustic pop, warm vocals, gentle guitar"></textarea></label><label>Songtext<textarea id="music-lyrics" maxlength="8000" rows="6" required placeholder="[Verse] … [Chorus] …"></textarea></label><label>Maximale Länge (Sekunden)<input type="number" id="music-duration" min="2" max="360" step="1" value="16" required></label><p id="music-length-hint" class="small">Bis etwa 16 Sekunden · 400 semantische Tokens. YuE2 verwendet hier ungefähr 25 Tokens pro Sekunde.</p><details><summary>Erweiterte Testparameter</summary><label>Maximale semantische Tokens<input type="number" id="music-tokens" min="32" max="9000" value="400"></label><label>NAR-Schritte<input type="number" id="music-steps" min="1" max="32" value="8"></label><label>Seed<input type="number" id="music-seed" min="0" max="2147483647" value="1234"></label></details><button type="button" class="secondary" id="music-load">Modell laden</button><button id="music-start">Musik erzeugen</button><button type="button" class="secondary" id="music-cancel">Abbrechen</button></form><div id="music-result"></div><p>RTX 5080 bevorzugt. Deck-Aufträge werden koordiniert. YuE2 bleibt zwischen Songs geladen, bis du die Betriebsart wechselst. Text und Stil werden nicht dauerhaft gespeichert.</p></section>';}
|
||||
function bind(){const root=document.querySelector('#music-test'),el=id=>root.querySelector('#'+id);let ready=false,busy=false,resultId=null;
|
||||
function html(){return '<section id="music-test" class="card"><h2>Musik ausprobieren</h2><p>YuE2 über audio.cpp oder ACE-Step XL-SFT mit 1.7B-Musik-Sprachmodell. Parameter richten sich nach dem gewählten Profil.</p><p id="music-state" role="status"></p><p id="music-error" role="alert"></p><div id="music-progress"></div><form id="music-form"><label>Profil<select id="music-profile" required></select></label><label>Musikstil<textarea id="music-style" maxlength="2000" required placeholder="English, acoustic pop, warm vocals, gentle guitar"></textarea></label><label>Songtext<textarea id="music-lyrics" maxlength="8000" rows="6" required placeholder="[Verse] … [Chorus] …"></textarea></label><label>Maximale Länge (Sekunden)<input type="number" id="music-duration" min="2" max="360" step="1" value="16" required></label><p id="music-length-hint" class="small">Bis etwa 16 Sekunden · 400 semantische Tokens. YuE2 verwendet hier ungefähr 25 Tokens pro Sekunde.</p><details><summary>Erweiterte Testparameter</summary><label>Maximale semantische Tokens<input type="number" id="music-tokens" min="32" max="9000" value="400"></label><label><span id="music-steps-label">NAR-Schritte</span><input type="number" id="music-steps" min="1" max="32" value="8"></label><div id="music-ace-options" hidden><label>Guidance<input type="number" id="music-guidance" min="0" max="20" step="0.1" value="7"></label><label><input type="checkbox" id="music-thinking" checked> Musik-Sprachmodell verwenden (Thinking)</label><label><input type="checkbox" id="music-instrumental"> Instrumental ohne Gesang</label><label>Gesangssprache<input id="music-language" value="unknown" maxlength="16" placeholder="de, en oder unknown"></label><label>BPM (leer = automatisch)<input type="number" id="music-bpm" min="30" max="300"></label></div><label>Seed<input type="number" id="music-seed" min="0" max="2147483647" value="1234"></label></details><button type="button" class="secondary" id="music-load">Modell laden</button><button id="music-start">Musik erzeugen</button><button type="button" class="secondary" id="music-cancel">Abbrechen</button></form><div id="music-result"></div><p>RTX 5080 bevorzugt. Deck-Aufträge werden koordiniert. Das gewählte Modell bleibt zwischen Songs geladen, bis du die Betriebsart wechselst. Text und Stil werden nicht dauerhaft gespeichert.</p></section>';}
|
||||
function bind(){const root=document.querySelector('#music-test'),el=id=>root.querySelector('#'+id);let ready=false,busy=false,resultId=null,profiles=[],ace=false;
|
||||
async function poll(){if(!root.isConnected)return;try{const s=await api('music');if(!root.isConnected)return;const j=s.job,running=j?.state==='running';el('music-state').textContent=(s.mode!=='music'?'Bitte in der Übersicht auf Musik umschalten.':j?.phase||'Profil wählen und Musikstil sowie Songtext eingeben.')+(running?' · '+Math.round((Date.now()/1000)-j.started_at)+' s':'');el('music-progress').innerHTML=running?'<progress aria-label="Musikgenerierung läuft"></progress>':'';el('music-start').disabled=busy||running||!ready||s.mode!=='music';el('music-load').disabled=busy||running||!ready||s.mode!=='music';el('music-cancel').disabled=!running;if(!busy&&j?.state==='complete'&&j.id!==resultId){resultId=j.id;el('music-result').innerHTML=`<h3>Ergebnis · ${e(j.duration_seconds)} Sekunden</h3><audio controls src="/api/v1/music/audio?id=${e(j.id)}"></audio><p><a download="athena-musik.wav" href="/api/v1/music/audio?id=${e(j.id)}">WAV herunterladen</a></p>`;}if(j?.state==='failed')el('music-error').textContent=j.phase;}catch(x){if(root.isConnected)el('music-error').textContent=x.message;}if(root.isConnected)setTimeout(poll,1500);}
|
||||
function updateLength(fromTokens=false){const tokens=fromTokens?Number(el('music-tokens').value):Math.round(Number(el('music-duration').value)*25);if(!fromTokens)el('music-tokens').value=tokens;else el('music-duration').value=(tokens/25).toFixed(2);el('music-length-hint').textContent=`Bis etwa ${(tokens/25).toFixed(2)} Sekunden · ${tokens} semantische Tokens. Das Modell kann früher enden.`;}
|
||||
function updateLength(fromTokens=false){if(ace){el('music-length-hint').textContent='Zieldauer in Sekunden · ACE-Step XL-SFT: 50 Schritte und Guidance 7 als Ausgangspunkt.';return;}const tokens=fromTokens?Number(el('music-tokens').value):Math.round(Number(el('music-duration').value)*25);if(!fromTokens)el('music-tokens').value=tokens;else el('music-duration').value=(tokens/25).toFixed(2);el('music-length-hint').textContent=`Bis etwa ${(tokens/25).toFixed(2)} Sekunden · ${tokens} semantische Tokens. Das Modell kann früher enden.`;}
|
||||
el('music-duration').step='0.04';el('music-duration').min='1.28';el('music-duration').oninput=()=>updateLength();el('music-tokens').oninput=()=>updateLength(true);
|
||||
api('profiles').then(s=>{if(!root.isConnected)return;const profiles=s.profiles.filter(p=>p.kind==='music'&&p.runnable);ready=profiles.length>0;el('music-profile').innerHTML=profiles.map(p=>`<option value="${e(p.id)}">${e(p.name)}</option>`).join('')||'<option value="">Zuerst Profil und Komponenten einrichten</option>';}).catch(x=>el('music-error').textContent=x.message);
|
||||
el('music-load').onclick=()=>api('music/load',{profile_id:el('music-profile').value}).catch(x=>el('music-error').textContent=x.message);el('music-form').onsubmit=async event=>{event.preventDefault();busy=true;el('music-start').disabled=true;el('music-error').textContent='';el('music-result').replaceChildren();resultId=null;try{await api('music/start',{profile_id:el('music-profile').value,lyrics:el('music-lyrics').value,style:el('music-style').value,seed:Number(el('music-seed').value),max_tokens:Number(el('music-tokens').value),steps:Number(el('music-steps').value)});}catch(x){el('music-error').textContent=x.message;}finally{busy=false;}};el('music-cancel').onclick=()=>api('music/cancel',{}).catch(x=>el('music-error').textContent=x.message);poll();}
|
||||
api('profiles').then(s=>{if(!root.isConnected)return;profiles=s.profiles.filter(p=>p.kind==='music'&&p.runnable);ready=profiles.length>0;el('music-profile').innerHTML=profiles.map(p=>`<option value="${e(p.id)}">${e(p.name)}</option>`).join('')||'<option value="">Zuerst Profil und Komponenten einrichten</option>';selectFamily();}).catch(x=>el('music-error').textContent=x.message);
|
||||
function selectFamily(){ace=profiles.find(p=>p.id===el('music-profile').value)?.model?.repo==='ACE-Step/acestep-v15-xl-sft';el('music-ace-options').hidden=!ace;el('music-tokens').parentElement.hidden=ace;el('music-steps-label').textContent=ace?'Diffusionsschritte':'NAR-Schritte';el('music-steps').max=ace?200:32;el('music-steps').value=ace?50:8;el('music-duration').min=ace?10:1.28;el('music-duration').max=ace?600:360;el('music-duration').step=ace?1:.04;el('music-duration').value=ace?30:16;el('music-lyrics').required=!ace;updateLength();}
|
||||
el('music-profile').onchange=selectFamily;
|
||||
el('music-load').onclick=()=>api('music/load',{profile_id:el('music-profile').value}).catch(x=>el('music-error').textContent=x.message);el('music-form').onsubmit=async event=>{event.preventDefault();busy=true;el('music-start').disabled=true;el('music-error').textContent='';el('music-result').replaceChildren();resultId=null;try{await api('music/start',{profile_id:el('music-profile').value,lyrics:el('music-lyrics').value,style:el('music-style').value,seed:Number(el('music-seed').value),max_tokens:Number(el('music-tokens').value),steps:Number(el('music-steps').value),...(ace?{duration_seconds:Number(el('music-duration').value),guidance:Number(el('music-guidance').value),thinking:el('music-thinking').checked,instrumental:el('music-instrumental').checked,bpm:el('music-bpm').value?Number(el('music-bpm').value):null,language:el('music-language').value}:{})});}catch(x){el('music-error').textContent=x.message;}finally{busy=false;}};el('music-cancel').onclick=()=>api('music/cancel',{}).catch(x=>el('music-error').textContent=x.message);poll();}
|
||||
return {html,bind};
|
||||
})();
|
||||
+10
-1
@@ -107,7 +107,10 @@ YUE2_COMPONENTS={
|
||||
'tokenizer':{'label':'Qwen-Tokenizer','files':['sidecars/yue2-qwen.tiktoken']},
|
||||
'vae_config':{'label':'VAE-Konfiguration','files':['sidecars/yue2-vae-config.json']}
|
||||
}
|
||||
from acestep_models import ACE_REPO,ACE_BASE_REPO,ACE_BASE_REVISION,ACE_FILES,ACE_BASE_FILES,ACE_COMPONENTS,acestep_recipe
|
||||
|
||||
def music_recipe(model):
|
||||
if acestep_recipe(model):return ACE_COMPONENTS
|
||||
return YUE2_COMPONENTS if model.get('kind')=='music' and model.get('repo')==YUE2_REPO and model.get('file') in ('yue2-3b-bf16.gguf','yue2-3b-q8_0.gguf','yue2-3b-q4_0.gguf') else None
|
||||
|
||||
VOXCPM2_REPO='openbmb/VoxCPM2'
|
||||
@@ -339,7 +342,7 @@ class Profiles:
|
||||
if not recipe or role not in recipe:raise ValueError('Für dieses Modell ist kein geprüftes Komponentenrezept hinterlegt.')
|
||||
item=self.catalog.entry(ident)
|
||||
if item['repo']!=recipe[role].get('repo',model['repo']) or item['kind']!=model['kind'] or item['file'] not in recipe[role]['files']:raise ValueError('Die Datei gehört nicht zu dieser Komponente des Modells.')
|
||||
if (video_recipe(model) or music_recipe(model) or voice_recipe(model)) and item['revision']!=model['revision']:raise ValueError('Komponente muss dieselbe Quellversion wie das Hauptmodell verwenden.')
|
||||
if (video_recipe(model) or music_recipe(model) or voice_recipe(model)) and item['revision']!=recipe[role].get('revision',model['revision']):raise ValueError('Komponente muss dieselbe Quellversion wie das Hauptmodell verwenden.')
|
||||
return item
|
||||
def components(self,model_id,extra_repo=None):
|
||||
model=self.catalog.entry(model_id)
|
||||
@@ -348,7 +351,12 @@ class Profiles:
|
||||
if model.get('kind')=='embeddings':return dict(supported=False,requirements=[],message='Für diese Embedding-Datei fehlt ein geprüftes Rezept. Zusatzdateien werden nicht pauschal verlangt. Unterstützt: ggml-org/embeddinggemma-300m-qat-q8_0-GGUF.')
|
||||
if extra_repo or not self._recipe(model):return self.manual_components(model,extra_repo)
|
||||
recipe=self._recipe(model);video=bool(video_recipe(model));source=self.catalog.files(model['repo'],model['revision']) if video or music_recipe(model) or voice_recipe(model) else self.catalog.files(next(iter(recipe.values())).get('repo',model['repo']));entries=self.catalog.status()['entries'];requirements=[]
|
||||
sources={}
|
||||
for role,info in recipe.items():
|
||||
if acestep_recipe(model):
|
||||
key=(info.get('repo',model['repo']),info.get('revision',model['revision']))
|
||||
if key not in sources:sources[key]=self.catalog.files(*key)
|
||||
source=sources[key]
|
||||
available=[]
|
||||
for item in entries:
|
||||
try:
|
||||
@@ -358,6 +366,7 @@ class Profiles:
|
||||
requirements.append(dict(role=role,label=info['label'],available=available,candidates=candidates))
|
||||
if omni_recipe(model):return dict(supported=True,requirements=requirements,source='https://huggingface.co/'+model['repo']+'/blob/'+model['revision']+'/README.md',license=source['license'],runtime='OmniVoice · Python/PyTorch',runtime_installed=bool(getattr(self,'omnivoice_runtime_ready',lambda:False)()),runtime_route='#omnivoice-runtime',worker_available=True,message='Originale OmniVoice-Laufzeit mit Audio- und Text-Tokenizer. Komponenten derselben Quellversion zuordnen. Stimmklonen benötigt Referenz-Audio und dessen Transkript; keine zusätzlichen ASR-Gewichte werden automatisch geladen.')
|
||||
if voice_recipe(model):return dict(supported=True,requirements=requirements,source='https://huggingface.co/'+model['repo']+'/blob/'+model['revision']+'/README.md',license=source['license'],runtime='VoxCPM · eigene Python/PyTorch-Laufzeit',runtime_installed=bool(getattr(self,'voxcpm_runtime_ready',lambda:False)()),runtime_route='#voxcpm-runtime',worker_available=True,message='VoxCPM2 benötigt genau diese fünf Zusatzdateien derselben Quellversion. Ein separater Textencoder und ein Vision-Projektor werden nicht benötigt. tokenizer.json und tokenizer_config.json gehören zusammen, sie sind keine doppelten Modelle. Vorhandene Dateien werden wiederverwendet. Die passende Laufzeit kann unter Einstellungen → Laufzeiten → VoxCPM installiert werden. Nach Zuordnung dieser Dateien unter Stimmwerkzeuge → Testen Sprache erzeugen oder eine WAV-Referenz für Stimmklonen verwenden.')
|
||||
if acestep_recipe(model):return dict(supported=True,requirements=requirements,source='https://huggingface.co/'+model['repo'],license=source['license'],runtime='ACE-Step 1.5 · eigene Python/PyTorch-Laufzeit',runtime_route='#acestep-runtime',runtime_installed=bool(getattr(self,'acestep_runtime_ready',lambda:False)()),worker_available=True,message='XL-SFT mit dem originalen 1.7B-Musik-Sprachmodell, Textencoder und VAE. Die Zusatzdateien stammen aus zwei geprüften Repositories. Vorhandene Dateien zuordnen oder fehlende herunterladen. Danach Musik → Testen; die Gewichte bleiben zwischen Songs geladen.')
|
||||
if music_recipe(model):return dict(supported=True,requirements=requirements,source='https://huggingface.co/'+model['repo']+'/blob/'+model['revision']+'/README.md',license=source['license'],runtime='audio.cpp',runtime_route='#audio-cpp-runtime',runtime_installed=bool(getattr(self,'music_runtime_ready',lambda:False)()),message='Passendes YuE2-GGUF-Paket: je eine VAE-Datei und die vier Zusatzdateien derselben Quellversion. F16-VAE ist die erste Downloadempfehlung. Vorhandene Dateien wiederverwenden, fehlende herunterladen und danach zuordnen. Die YuE2-Musikanbindung verwendet diese Dateien über audio.cpp. Speichern startet kein Modell; anschließend Musik → Testen verwenden.')
|
||||
if video:return dict(supported=True,requirements=requirements,source='https://huggingface.co/'+model['repo']+'/blob/'+model['revision']+'/README.md',license=source['license'],runtime='ComfyUI · gemeinsame Bild- und Videolaufzeit',runtime_route='#image-runtime',runtime_installed=bool(getattr(self,'video_runtime_ready',lambda:False)()),message='Geprüftes Dateirezept nach Herstellerdokumentation für die zweistufige Distilled-Pipeline mit fester Bildanzahl. Alle Komponenten stammen aus derselben Version wie dein Transformer. Kein beliebiger Gemma-Encoder; keine Comfy-INT8-Dateien. Optionaler Duration-Head, Temporal-Upsampling und DFR sind nicht Teil dieses Rezepts. Vorhandene ComfyUI-Laufzeit wiederverwenden; Videomodell im Bereich Video aktivieren. Vollständige Dateien sind keine Speicherzusage.')
|
||||
if not image_recipe(model):return dict(supported=True,requirements=requirements,source=source['url'],license=source['license'],runtime='audio.cpp · Paketdefinition',runtime_installed=bool(getattr(self,'music_runtime_ready',lambda:False)()),message='Zusatzdateien aus der installierten Laufzeit-Paketdefinition. Weitere modellabhängige Pakete können erforderlich sein; dies ist keine vollständige Worker-Zusage.')
|
||||
|
||||
@@ -141,7 +141,11 @@ class Server(ThreadingHTTPServer):
|
||||
self.audio_cpp_runtime=AudioCppRuntime(self.catalog.root.parent/'audio-cpp-runtime')
|
||||
self.profiles.music_runtime_ready=lambda:self.audio_cpp_runtime.status()['installed']
|
||||
from music import Music
|
||||
self.music=Music(self.catalog.root.parent/'music-jobs',self.profiles,self.catalog,self.audio_cpp_runtime,self.scheduler)
|
||||
from acestep_runtime import AceStepRuntime
|
||||
from acestep import AceStep,MusicRouter
|
||||
self.acestep_runtime=AceStepRuntime(self.catalog.root.parent/'acestep-runtime')
|
||||
self.profiles.acestep_runtime_ready=lambda:self.acestep_runtime.status()['installed']
|
||||
self.music=MusicRouter(Music(self.catalog.root.parent/'music-jobs',self.profiles,self.catalog,self.audio_cpp_runtime,self.scheduler),AceStep(self.catalog.root.parent/'acestep-jobs',self.profiles,self.catalog,self.acestep_runtime,self.scheduler))
|
||||
self.profiles.music_blockers=self.music.blockers
|
||||
self.endpoint.music=self.music
|
||||
from profiles import audio_package_recipe
|
||||
@@ -151,7 +155,7 @@ class Server(ThreadingHTTPServer):
|
||||
self.endpoint.video=self.video
|
||||
self.video.separator_status=lambda:dict(self.separator_runtime.status(),worker=self.separator_tests.status())
|
||||
self.video.voice_profiles=lambda:[dict(id=p['id'],name=p['name']) for p in self.endpoint.rows() if p['kind']=='voice' and p['enabled'] and p['runnable']]
|
||||
self.video.music_profiles=lambda:[dict(id=p['id'],name=p['name']) for p in self.endpoint.rows() if p['kind']=='music' and p['enabled'] and p['runnable']]
|
||||
self.video.music_profiles=lambda:[dict(id=p['id'],name=p['name'],family='ACE-Step' if p.get('model',{}).get('repo')=='ACE-Step/acestep-v15-xl-sft' else 'YuE2') for p in self.endpoint.rows() if p['kind']=='music' and p['enabled'] and p['runnable']]
|
||||
self.profiles.video_runtime_ready=lambda:self.image_runtime.status().get("installed",False)
|
||||
from dashboard_data import Dashboard
|
||||
self.dashboard=Dashboard(self,self.catalog.root.parent)
|
||||
@@ -339,6 +343,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
'image':self.server.image_runtime.status().get('installed',False),
|
||||
'audio':self.server.tts_runtime.status().get('installed',False),
|
||||
'video':video_runtime.status().get('installed',False),
|
||||
'acestep':self.server.acestep_runtime.status()['installed'],
|
||||
'audio_cpp':self.server.audio_cpp_runtime.status()['installed'],
|
||||
'omnivoice':self.server.omnivoice_runtime.status()['installed'],'voxcpm':self.server.voxcpm_runtime.status()['installed'],'music_worker':True,'separator':self.server.separator_runtime.status()['installed']}
|
||||
|
||||
@@ -356,7 +361,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
return self.respond({'error':'Anmeldung erforderlich.'},401)
|
||||
if not self.authenticated() and self.path == '/':
|
||||
return self.respond((ROOT/'login.html').read_bytes(), mime='text/html; charset=utf-8')
|
||||
routes = {'/voice-ui.js':('voice-ui.js','text/javascript'),'/voxcpm-ui.js':('voxcpm-ui.js','text/javascript'),'/separator-ui.js':('separator-ui.js','text/javascript'),'/music-ui.js':('music-ui.js','text/javascript'),'/audio-cpp-ui.js':('audio-cpp-ui.js','text/javascript'),'/ltx-original-ui.js':('ltx-original-ui.js','text/javascript'),'/backup-ui.js':('backup-ui.js','text/javascript'),'/dashboard-ui.js':('dashboard-ui.js','text/javascript'),'/dashboard.css':('dashboard.css','text/css'),'/themes.css':('themes.css','text/css'),'/video-ui.js':('video-ui.js','text/javascript'),'/stt-ui.js':('stt-ui.js','text/javascript'),'/tts-ui.js':('tts-ui.js','text/javascript'),'/auto-test-ui.js':('auto-test-ui.js','text/javascript'),'/chat-test-ui.js':('chat-test-ui.js','text/javascript'),'/endpoint-ui.js':('endpoint-ui.js','text/javascript'),'/docker-ui.js': ('docker-ui.js','text/javascript'), '/': ('index.html', 'text/html; charset=utf-8'), '/app.js': ('app.js', 'text/javascript'), '/style.css': ('style.css', 'text/css'), '/network-ui.js': ('network-ui.js', 'text/javascript'), '/access-ui.js': ('access-ui.js', 'text/javascript'), '/studio.js': ('studio.js', 'text/javascript'), '/catalog-ui.js': ('catalog-ui.js','text/javascript'), '/runtime-ui.js': ('runtime-ui.js','text/javascript'), '/profiles-ui.js': ('profiles-ui.js','text/javascript'), '/image-test-ui.js': ('image-test-ui.js','text/javascript')}
|
||||
routes = {'/acestep-ui.js':('acestep-ui.js','text/javascript'),'/voice-ui.js':('voice-ui.js','text/javascript'),'/voxcpm-ui.js':('voxcpm-ui.js','text/javascript'),'/separator-ui.js':('separator-ui.js','text/javascript'),'/music-ui.js':('music-ui.js','text/javascript'),'/audio-cpp-ui.js':('audio-cpp-ui.js','text/javascript'),'/ltx-original-ui.js':('ltx-original-ui.js','text/javascript'),'/backup-ui.js':('backup-ui.js','text/javascript'),'/dashboard-ui.js':('dashboard-ui.js','text/javascript'),'/dashboard.css':('dashboard.css','text/css'),'/themes.css':('themes.css','text/css'),'/video-ui.js':('video-ui.js','text/javascript'),'/stt-ui.js':('stt-ui.js','text/javascript'),'/tts-ui.js':('tts-ui.js','text/javascript'),'/auto-test-ui.js':('auto-test-ui.js','text/javascript'),'/chat-test-ui.js':('chat-test-ui.js','text/javascript'),'/endpoint-ui.js':('endpoint-ui.js','text/javascript'),'/docker-ui.js': ('docker-ui.js','text/javascript'), '/': ('index.html', 'text/html; charset=utf-8'), '/app.js': ('app.js', 'text/javascript'), '/style.css': ('style.css', 'text/css'), '/network-ui.js': ('network-ui.js', 'text/javascript'), '/access-ui.js': ('access-ui.js', 'text/javascript'), '/studio.js': ('studio.js', 'text/javascript'), '/catalog-ui.js': ('catalog-ui.js','text/javascript'), '/runtime-ui.js': ('runtime-ui.js','text/javascript'), '/profiles-ui.js': ('profiles-ui.js','text/javascript'), '/image-test-ui.js': ('image-test-ui.js','text/javascript')}
|
||||
if self.path in routes:
|
||||
name, mime = routes[self.path]
|
||||
return self.respond((ROOT/name).read_bytes(), mime=mime)
|
||||
@@ -395,6 +400,8 @@ class Handler(BaseHTTPRequestHandler):
|
||||
try:
|
||||
query=parse_qs(urlsplit(self.path).query);return self.respond(self.server.separator_tests.audio(query.get('id',[''])[0],int(query.get('index',['-1'])[0])),mime='audio/wav')
|
||||
except (ValueError,OSError):return self.respond({'error':'Spur nicht verfügbar.'},404)
|
||||
if self.path == '/api/v1/acestep-runtime':return self.respond(self.server.acestep_runtime.status())
|
||||
if self.path == '/api/v1/acestep-runtime/log':return self.respond(self.server.acestep_runtime.log())
|
||||
if self.path == '/api/v1/audio-cpp-runtime':return self.respond(self.server.audio_cpp_runtime.status())
|
||||
if self.path == '/api/v1/audio-cpp-runtime/log':return self.respond(self.server.audio_cpp_runtime.log())
|
||||
if self.path == '/api/v1/ltx-original-runtime':return self.respond(self.server.ltx_original_runtime.status())
|
||||
@@ -617,6 +624,11 @@ class Handler(BaseHTTPRequestHandler):
|
||||
if not {'model'}<=set(fields) or set(fields)-{'model','target'}:raise ValueError('Nur Modell, Zielspur und WAV-Datei erwartet.')
|
||||
return self.respond(self.server.separator_tests.start(fields['model'],audio,target=fields.get('target'),full=self.path=='/api/v1/separator-jobs/start'))
|
||||
except (ValueError,OSError) as exc:return self.respond({'error':str(exc)},400)
|
||||
if self.path in ('/api/v1/acestep-runtime/install','/api/v1/acestep-runtime/cancel'):
|
||||
try:
|
||||
if self.read_json():raise ValueError('Keine Installationsparameter erwartet.')
|
||||
return self.respond(self.server.acestep_runtime.stop() if self.path.endswith('/cancel') else self.server.acestep_runtime.start())
|
||||
except (OSError,ValueError) as exc:return self.respond({'error':str(exc)},400)
|
||||
if self.path in ('/api/v1/audio-cpp-runtime/install','/api/v1/audio-cpp-runtime/cancel'):
|
||||
try:
|
||||
if self.read_json():raise ValueError('Keine Installationsparameter erwartet.')
|
||||
@@ -664,7 +676,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
if self.path.endswith('/load'):
|
||||
if set(data)!={'profile_id'}:raise ValueError('Nur Profil-ID zum Vorladen erwartet.')
|
||||
return self.respond(self.server.music.load(data['profile_id']))
|
||||
if set(data)-{'profile_id','lyrics','style','seed','max_tokens','steps'} or not {'profile_id','lyrics','style'}<=set(data):raise ValueError('Ungültige Musikfelder.')
|
||||
if set(data)-{'profile_id','lyrics','style','seed','max_tokens','steps','duration_seconds','guidance','thinking','instrumental','bpm','language'} or not {'profile_id','lyrics','style'}<=set(data):raise ValueError('Ungültige Musikfelder.')
|
||||
return self.respond(self.server.music.start(**data))
|
||||
except ValueError as exc:return self.respond({'error':str(exc)},400)
|
||||
if self.path in ('/api/v1/voice/start','/api/v1/voice/cancel'):
|
||||
@@ -837,7 +849,7 @@ def main():
|
||||
server.tts_runtime.stop();server.voxcpm_runtime.stop();server.omnivoice_runtime.stop()
|
||||
server.image_runtime.stop()
|
||||
server.ltx_original_runtime.stop()
|
||||
server.separator_tests.stop();server.separator_runtime.stop();server.music.close();server.audio_cpp_runtime.stop()
|
||||
server.separator_tests.stop();server.separator_runtime.stop();server.music.close();server.acestep_runtime.stop();server.audio_cpp_runtime.stop()
|
||||
server.prompt_enhancer.stop()
|
||||
server.image_tests.stop()
|
||||
server.runtime.stop()
|
||||
|
||||
@@ -36,6 +36,7 @@ const Studio=(()=>{
|
||||
['ComfyUI + GGUF','Bilder & Video','image-runtime','/api/v1/image-runtime','Einmal installieren und für unterstützte Bild- und Videomodelle wiederverwenden. Gepinnte Versionen werden mit Deck gepflegt.'],
|
||||
['Qwen3-TTS','Sprachausgabe','tts-runtime','/api/v1/tts','CUDA-Laufzeit für unterstützte Qwen3-TTS-Modelle. Die Einrichtung lädt auch das vorgesehene Stimmenmodell.'],
|
||||
['Qwen3-ASR','Spracherkennung','stt-runtime','/api/v1/stt','Verwendet llama.cpp. Modell und Audio-Projektor werden in der Einrichtung zugeordnet.'],
|
||||
['ACE-Step 1.5','Musikgenerierung','acestep-runtime','/api/v1/acestep-runtime','XL-SFT mit 1.7B-Musik-Sprachmodell. Eigene Python/PyTorch-Laufzeit und dauerhaft geladene Gewichte.'],
|
||||
['audio.cpp','Musik & Audio','audio-cpp-runtime','/api/v1/audio-cpp-runtime','CUDA-Build einmal erstellen. YuE2 ist angebunden; andere Modellfamilien brauchen eine geprüfte Worker-Anbindung.'],
|
||||
['LTX Original','Video','ltx-original-runtime','/api/v1/ltx-original-runtime','Originales LTX-Backend für LTX DeskWEB. Modelle und Zusatzdateien bleiben in der Bibliothek.'],
|
||||
['Docker Engine','Weitere Dienste','docker-runtime','/api/v1/docker','Optionale Container-Umgebung. Erstinstallation über den Systemhelfer; vorhandenes Docker wird nicht automatisch aktualisiert.'],
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
import json,tempfile,time,unittest,wave
|
||||
from pathlib import Path
|
||||
from unittest.mock import Mock,patch
|
||||
from acestep import AceStep,MusicRouter
|
||||
from acestep_models import ACE_REPO,ACE_BASE_REPO,ACE_BASE_REVISION,ACE_COMPONENTS,acestep_recipe
|
||||
from profiles import Profiles
|
||||
from execution_setup import assess
|
||||
|
||||
class AceTests(unittest.TestCase):
|
||||
def profile(self):return dict(id='p',kind='music',model=dict(id='m',kind='music',repo=ACE_REPO,file='model-00001-of-00004.safetensors',revision='a'*40),runnable=True,components={})
|
||||
def worker(self,root):
|
||||
p=self.profile();profiles=Mock();profiles.status.return_value=dict(profiles=[p]);runtime=Mock();runtime.status.return_value={'installed':True};scheduler=Mock();scheduler.gpu_mode='music'
|
||||
return AceStep(root,profiles,Mock(),runtime,scheduler),p
|
||||
def test_duration_guidance_and_instrumental_validation_before_gpu(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
worker,p=self.worker(root)
|
||||
for options in ({'duration_seconds':9},{'duration_seconds':float('nan')},{'guidance':21},{'thinking':'yes'},{'steps':201},{'bpm':400}):
|
||||
with self.assertRaises(ValueError):worker.start('p',style='test',instrumental=True,**options)
|
||||
worker.scheduler.image_reservation.assert_not_called()
|
||||
def test_two_songs_keep_same_resident_worker_and_release_each_lease(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
worker,p=self.worker(root);process=Mock();process.poll.return_value=None;worker.process=process
|
||||
worker._ensure_session=Mock(side_effect=lambda p:setattr(worker,'session_ready',True));worker.session_key=('p','m',())
|
||||
def result(path,timeout):
|
||||
with wave.open(str(path.parent/'result.wav'),'wb') as wav:wav.setparams((1,2,8000,0,'NONE','none'));wav.writeframes(bytes(1600))
|
||||
return dict(ok=True)
|
||||
worker._await=Mock(side_effect=result)
|
||||
for i in range(2):
|
||||
job=worker.start('p',style='country',instrumental=True)
|
||||
for _ in range(100):
|
||||
if worker.job['state']!='running':break
|
||||
time.sleep(.01)
|
||||
self.assertEqual(worker.job['state'],'complete');self.assertTrue(worker.status()['loaded']);self.assertTrue(worker.audio(job['id']).startswith(b'RIFF'))
|
||||
self.assertEqual(worker.process,process);self.assertEqual(worker.scheduler.image_reservation.call_count,2)
|
||||
self.assertEqual(worker.scheduler.image_reservation.return_value.call_count,2)
|
||||
request=json.loads(process.stdin.write.call_args[0][0]);self.assertEqual(request['steps'],50);self.assertEqual(request['guidance'],7);self.assertTrue(request['thinking'])
|
||||
def test_music_router_switch_closes_old_family_but_same_profile_keeps_weights(self):
|
||||
p=self.profile();yue=Mock(job=None);ace=Mock(job=None);yue.profiles.status.return_value=dict(profiles=[p]);router=MusicRouter(yue,ace)
|
||||
router.load('p');yue.close.assert_called_once();router.load('p');ace.close.assert_not_called()
|
||||
ace.job={'state':'running'}
|
||||
with self.assertRaises(ValueError):router.load('p')
|
||||
def test_cross_repo_components_have_independent_pinned_revision(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
catalog=Mock();profiles=Profiles(Path(root)/'profiles.json',catalog);model=self.profile()['model'];role='ace_base_0';info=ACE_COMPONENTS[role]
|
||||
catalog.entry.return_value=dict(repo=ACE_BASE_REPO,kind='music',file=info['files'][0],revision=ACE_BASE_REVISION)
|
||||
profiles._component(model,role,'x')
|
||||
catalog.entry.return_value['revision']='b'*40
|
||||
with self.assertRaises(ValueError):profiles._component(model,role,'x')
|
||||
def test_execution_wizard_offers_ace_instead_of_audio_cpp(self):
|
||||
result=assess(self.profile()['model'],{'acestep':True})
|
||||
self.assertEqual(result['family'],'ACE-Step 1.5 XL-SFT');self.assertEqual(result['candidates'][0]['id'],'acestep');self.assertEqual(result['setup_steps'][1]['state'],'complete')
|
||||
def test_cancel_maps_owned_process_failure_to_cancelled(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
worker,p=self.worker(root);worker.job={'id':'a'*32,'state':'running'}
|
||||
def interrupted(p):worker.cancel.set();raise ValueError('worker stopped')
|
||||
worker._ensure_session=interrupted;worker._run(p,None,None,0,400,50,False)
|
||||
self.assertEqual(worker.job['state'],'cancelled');worker.scheduler.image_reservation.return_value.assert_called_once()
|
||||
|
||||
def test_package_components_are_not_separate_music_profiles(self):
|
||||
from catalog import file_role
|
||||
for file in ('Qwen3-Embedding-0.6B/model.safetensors','acestep-5Hz-lm-1.7B/model.safetensors','model-00002-of-00004.safetensors'):
|
||||
self.assertFalse(file_role(file)['profile_eligible'])
|
||||
self.assertTrue(file_role('model-00001-of-00004.safetensors')['profile_eligible'])
|
||||
def test_auxiliary_download_allowlist_is_exact_and_restorable(self):
|
||||
from catalog import Catalog
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
catalog=Catalog(root);catalog._metadata=Mock(return_value=dict(sha='a'*40,siblings=[dict(rfilename=name,size=10) for name in ('modeling_acestep_v15_xl_base.py','silence_latent.pt','other.py')]))
|
||||
files=catalog.files(ACE_REPO,'a'*40)['files']
|
||||
self.assertEqual({f['name'] for f in files},{'modeling_acestep_v15_xl_base.py','silence_latent.pt'})
|
||||
def test_runtime_ui_script_is_served(self):
|
||||
import http.client,threading
|
||||
from server import Server,Handler
|
||||
with tempfile.TemporaryDirectory() as root,patch.dict('os.environ',{'DECK_NETWORK_MODE':'disabled','DECK_REQUIRE_SETUP':'0'}):
|
||||
server=Server(0,state_dir=Path(root));thread=threading.Thread(target=server.serve_forever,daemon=True);thread.start()
|
||||
try:
|
||||
with patch.object(Handler,'authenticated',return_value=True):
|
||||
conn=http.client.HTTPConnection('127.0.0.1',server.server_port,timeout=3);conn.request('GET','/acestep-ui.js');r=conn.getresponse();self.assertEqual(r.status,200);self.assertIn(b'window.AceStepUI',r.read());conn.close()
|
||||
finally:server.shutdown();server.dashboard.close();server.server_close();thread.join()
|
||||
|
||||
if __name__=='__main__':unittest.main()
|
||||
@@ -33,6 +33,15 @@ class RestoreTests(unittest.TestCase):
|
||||
self.server.runtime.prerequisites=Mock(return_value={'cuda_ready':True,'cpu_ready':True})
|
||||
def tearDown(self):
|
||||
self.server.backup.stop();self.server.endpoint.close();self.server.video.close();self.server.dashboard.close();self.server.server_close();self.tmp.cleanup();self.env.stop();self.disk.stop()
|
||||
def test_acestep_runtime_recipe_and_version_survive_backup(self):
|
||||
from acestep_runtime import VERSION
|
||||
self.server.acestep_runtime.status=Mock(return_value=dict(installed=True,version=VERSION,job=None))
|
||||
doc=self.server.backup.snapshot();validate(doc)
|
||||
self.assertTrue(doc['runtimes']['acestep']);self.assertEqual(doc['runtime_versions']['acestep'],VERSION)
|
||||
self.server.acestep_runtime.status=Mock(return_value=dict(installed=False,version=VERSION,job=None))
|
||||
self.server.acestep_runtime.start=Mock();self.server.backup._wait=Mock()
|
||||
self.server.backup.job=dict(state='running',items=[],completed=0,phase='ACE-Step-Test')
|
||||
self.server.backup._runtimes(doc);self.server.acestep_runtime.start.assert_called_once();self.server.backup.job['state']='complete'
|
||||
def model(self):
|
||||
data=b'model-weights-not-in-backup';repo='test/model';revision='a'*40;filename='model.gguf';ident=hashlib.sha256((repo+revision+filename).encode()).hexdigest();p=self.root/'models'/ident;p.mkdir(parents=True)
|
||||
(p/'model.gguf').write_bytes(data);entry=dict(repo=repo,revision=revision,file=filename,size=len(data),sha256=hashlib.sha256(data).hexdigest(),kind='chat',state='downloaded');(p/'entry.json').write_text(json.dumps(entry));return ident
|
||||
|
||||
@@ -164,6 +164,12 @@ class EndpointTests(unittest.TestCase):
|
||||
response=conn.getresponse();self.assertEqual(response.status,200);self.assertEqual(response.getheader('Content-Type'),'audio/wav');self.assertEqual(response.read(),b'RIFFsynthetic-WAV');conn.close()
|
||||
self.assertEqual(self.request('/v1/audio/music',dict(model='Music',lyrics='Synthetic',style='pop',unsupported=True))[0],400)
|
||||
self.assertEqual(self.request('/v1/audio/music/models',token='bad')[0],401)
|
||||
# ACE-specific controls pass through unchanged; no YuE2 step default.
|
||||
conn=http.client.HTTPConnection('127.0.0.1',self.port,timeout=3)
|
||||
conn.request('POST','/v1/audio/music',json.dumps(dict(model='Music',style='country',instrumental=True,duration_seconds=30,guidance=7,thinking=True,bpm=120,language='en')),{'Content-Type':'application/json','Authorization':'Bearer '+'A'*32})
|
||||
response=conn.getresponse();self.assertEqual(response.status,200);self.assertEqual(response.read(),b'RIFFsynthetic-WAV');conn.close()
|
||||
args=self.ep.music.start.call_args
|
||||
self.assertEqual(args.args[1],'');self.assertIsNone(args.kwargs['steps']);self.assertEqual(args.kwargs['duration_seconds'],30);self.assertTrue(args.kwargs['instrumental'])
|
||||
def test_separator_mode_rejects_chat_without_starting_worker_or_relay(self):
|
||||
self.ep.scheduler.gpu_mode='separator';self.ep.video=Mock()
|
||||
status,error=self.request('/v1/chat/completions',dict(model='alpha',messages=[dict(role='user',content='Synthetic')]))
|
||||
|
||||
Reference in new issue
Block a user