fix: v0.23.0 security — trust_remote_code warning panels for AWQ/GPTQ export

This commit is contained in:
Alpamys 2026-04-03 14:01:16 +05:00
parent f272ee2f4f
commit 50ccf15113
2 changed files with 16 additions and 0 deletions

View File

@ -275,6 +275,8 @@ soup version # Show version (--full for details)
- **AWQ/GPTQ export**: calibration data path traversal protection — resolve + relative_to(cwd) (v0.23.0)
- **AWQ/GPTQ export**: output path stays under cwd (v0.23.0)
- **Curriculum config**: curriculum_buckets bounded ge=1, le=20 (v0.23.0)
- **AWQ/GPTQ export**: trust_remote_code warning panel before model loading (v0.23.0)
- **Data split**: output files written to input's parent dir (consistent with sample_data) (v0.23.0)
## Code Conventions

View File

@ -709,6 +709,13 @@ def _export_awq(
)
try:
console.print(
Panel(
"[yellow]Warning:[/] Loading model with trust_remote_code=True.\n"
"This may execute custom code from the model directory.",
title="Security Notice",
)
)
console.print("[dim]Loading model for AWQ quantization...[/]")
model = AutoAWQForCausalLM.from_pretrained(str(source_path))
tokenizer = AutoTokenizer.from_pretrained(str(source_path), trust_remote_code=True)
@ -817,6 +824,13 @@ def _export_gptq(
)
try:
console.print(
Panel(
"[yellow]Warning:[/] Loading model with trust_remote_code=True.\n"
"This may execute custom code from the model directory.",
title="Security Notice",
)
)
console.print("[dim]Loading model for GPTQ quantization...[/]")
quantize_config = BaseQuantizeConfig(
bits=bits,