From 176ae1f17ad60f8066ab9da670779a72ace3e458 Mon Sep 17 00:00:00 2001 From: Roland Tannous Date: Tue, 14 Apr 2026 22:39:02 +0400 Subject: [PATCH] studio: route /export/gguf through quantization_method normalizer Call normalize_gguf_quantization_method on request.quantization_method before invoking the export backend. Empty lists surface as HTTP 400 via the helper's ValueError. Legacy single-string callers are wrapped transparently; batch callers pass the list directly. After this commit the route always hands the backend a List[str]. --- studio/backend/routes/export.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/studio/backend/routes/export.py b/studio/backend/routes/export.py index 3e60eaaf20..6634470e23 100644 --- a/studio/backend/routes/export.py +++ b/studio/backend/routes/export.py @@ -38,6 +38,7 @@ from models import ( ExportGGUFRequest, ExportLoRAAdapterRequest, ) +from models.export import normalize_gguf_quantization_method router = APIRouter() logger = get_logger(__name__) @@ -253,11 +254,18 @@ async def export_gguf( Wraps ExportBackend.export_gguf. """ + try: + normalized_methods = normalize_gguf_quantization_method( + request.quantization_method, + ) + except ValueError as exc: + raise HTTPException(status_code = 400, detail = str(exc)) + try: backend = get_export_backend() success, message = backend.export_gguf( save_directory = request.save_directory, - quantization_method = request.quantization_method, + quantization_method = normalized_methods, push_to_hub = request.push_to_hub, repo_id = request.repo_id, hf_token = request.hf_token,