Install native audio separator with model packages WAV tests and restore recipe

This commit is contained in:
Mikei386
2026-10-01 12:00:36 +02:00
parent c3db35dada
commit 66b035c8d7
20 changed files with 368 additions and 23 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ def validate_wav(audio):
if len(w.readframes(w.getnframes()))!=w.getnframes()*2:raise ValueError('WAV-Datei ist unvollständig.')
except (wave.Error,EOFError):raise ValueError('Ungültige WAV-Datei.') from None
def read_upload(handler):
def read_upload(handler,validate=True):
handler.connection.settimeout(30)
if handler.headers.get('Transfer-Encoding'):raise ValueError('Chunked Upload wird nicht unterstützt.')
try:length=int(handler.headers.get('Content-Length','0'))
@@ -44,7 +44,7 @@ def read_upload(handler):
if name not in ('model','profile_id','language','response_format') or name in fields or len(data)>256:raise ValueError('Ungültiges oder doppeltes Feld.')
try:fields[name]=data.decode('utf-8')
except UnicodeError:raise ValueError('Ungültiges Textfeld.') from None
validate_wav(audio)
if validate:validate_wav(audio)
if fields.get('response_format','json')!='json':raise ValueError('Aktuell wird response_format=json unterstützt.')
return fields,audio