Use qwen3-asr throughout speech integrations
This commit is contained in:
+12
-12
@@ -71,13 +71,13 @@ def test_quoted_boundary():
|
||||
boundary = "----WebKitFormBoundary7MA4YWxkTrZu0gW"
|
||||
webm = b"\x1a\x45\xdf\xa3" + b"\x00\x01\x02\x03\xff\xfe\xfd" * 50
|
||||
body, ct = build(
|
||||
[("model", "whisper-1", None), ("file", webm, "t.webm")],
|
||||
[("model", "qwen3-asr", None), ("file", webm, "t.webm")],
|
||||
boundary, quoted=True,
|
||||
)
|
||||
fd, fn, fl = parse_multipart(body, ct)
|
||||
assert fd == webm, "file_data mismatch"
|
||||
assert fn == "t.webm", f"filename mismatch: {fn!r}"
|
||||
assert fl["model"] == "whisper-1", f"model mismatch: {fl!r}"
|
||||
assert fl["model"] == "qwen3-asr", f"model mismatch: {fl!r}"
|
||||
print(" quoted boundary: OK")
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ def test_openwebui_style():
|
||||
f"\r\n--{boundary}\r\n"
|
||||
f'Content-Disposition: form-data; name="model"\r\n'
|
||||
f"\r\n"
|
||||
f"whisper-1\r\n"
|
||||
f"qwen3-asr\r\n"
|
||||
f"--{boundary}\r\n"
|
||||
f'Content-Disposition: form-data; name="temperature"\r\n'
|
||||
f"\r\n"
|
||||
@@ -119,7 +119,7 @@ def test_openwebui_style():
|
||||
fd, fn, fl = parse_multipart(body, ct)
|
||||
assert fd == webm, "file_data mismatch"
|
||||
assert fn == "rec.webm", f"filename mismatch: {fn!r}"
|
||||
assert fl["model"] == "whisper-1", f"model mismatch: {fl!r}"
|
||||
assert fl["model"] == "qwen3-asr", f"model mismatch: {fl!r}"
|
||||
assert fl["temperature"] == "0.0", f"temperature mismatch: {fl!r}"
|
||||
print(" Open-WebUI-artig: OK")
|
||||
|
||||
@@ -128,13 +128,13 @@ def test_file_before_model():
|
||||
"""File-Feld vor model-Feld."""
|
||||
boundary = "boundary123"
|
||||
body, ct = build(
|
||||
[("file", b"DATA", "f.wav"), ("model", "whisper-1", None)],
|
||||
[("file", b"DATA", "f.wav"), ("model", "qwen3-asr", None)],
|
||||
boundary, quoted=False,
|
||||
)
|
||||
fd, fn, fl = parse_multipart(body, ct)
|
||||
assert fd == b"DATA", "file_data mismatch"
|
||||
assert fn == "f.wav", f"filename mismatch: {fn!r}"
|
||||
assert fl["model"] == "whisper-1", f"model mismatch: {fl!r}"
|
||||
assert fl["model"] == "qwen3-asr", f"model mismatch: {fl!r}"
|
||||
print(" File vor model: OK")
|
||||
|
||||
|
||||
@@ -142,13 +142,13 @@ def test_file_after_model():
|
||||
"""model-Feld vor File-Feld."""
|
||||
boundary = "boundary456"
|
||||
body, ct = build(
|
||||
[("model", "whisper-1", None), ("file", b"DATA", "g.wav")],
|
||||
[("model", "qwen3-asr", None), ("file", b"DATA", "g.wav")],
|
||||
boundary, quoted=False,
|
||||
)
|
||||
fd, fn, fl = parse_multipart(body, ct)
|
||||
assert fd == b"DATA", "file_data mismatch"
|
||||
assert fn == "g.wav", f"filename mismatch: {fn!r}"
|
||||
assert fl["model"] == "whisper-1", f"model mismatch: {fl!r}"
|
||||
assert fl["model"] == "qwen3-asr", f"model mismatch: {fl!r}"
|
||||
print(" File nach model: OK")
|
||||
|
||||
|
||||
@@ -182,13 +182,13 @@ def test_extra_headers_ignored():
|
||||
f"\r\n--{boundary}\r\n"
|
||||
f'Content-Disposition: form-data; name="model"\r\n'
|
||||
f"\r\n"
|
||||
f"whisper-1\r\n"
|
||||
f"qwen3-asr\r\n"
|
||||
f"--{boundary}--\r\n"
|
||||
).encode()
|
||||
fd, fn, fl = parse_multipart(body, ct)
|
||||
assert fd == webm, "file_data mismatch"
|
||||
assert fn == "x.webm", f"filename mismatch: {fn!r}"
|
||||
assert fl["model"] == "whisper-1", f"model mismatch: {fl!r}"
|
||||
assert fl["model"] == "qwen3-asr", f"model mismatch: {fl!r}"
|
||||
print(" Extra-Header ignoriert: OK")
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ def test_all_fields():
|
||||
body, ct = build(
|
||||
[
|
||||
("file", b"AUDIO", "a.webm"),
|
||||
("model", "whisper-1", None),
|
||||
("model", "qwen3-asr", None),
|
||||
("language", "de", None),
|
||||
("prompt", "Kontext", None),
|
||||
("response_format", "verbose_json", None),
|
||||
@@ -209,7 +209,7 @@ def test_all_fields():
|
||||
fd, fn, fl = parse_multipart(body, ct)
|
||||
assert fd == b"AUDIO", "file_data mismatch"
|
||||
assert fn == "a.webm", f"filename mismatch: {fn!r}"
|
||||
assert fl["model"] == "whisper-1", f"model mismatch: {fl!r}"
|
||||
assert fl["model"] == "qwen3-asr", f"model mismatch: {fl!r}"
|
||||
assert fl["language"] == "de", f"language mismatch: {fl!r}"
|
||||
assert fl["prompt"] == "Kontext", f"prompt mismatch: {fl!r}"
|
||||
assert fl["response_format"] == "verbose_json", f"response_format mismatch: {fl!r}"
|
||||
|
||||
Reference in New Issue
Block a user