[BugFix] Avoid ignored trust_remote_code warnings (#36290)

Signed-off-by: Nick Hill <nickhill123@gmail.com>
This commit is contained in:
Nick Hill
2026-03-07 01:24:18 +00:00
committed by GitHub
parent b354686524
commit c7f32e08c2
6 changed files with 29 additions and 9 deletions
+7
View File
@@ -27,6 +27,13 @@ def is_cloud_storage(model_or_path: str) -> bool:
return is_s3(model_or_path) or is_gcs(model_or_path)
def without_trust_remote_code(kwargs: dict[str, Any]) -> dict[str, Any]:
"""Return kwargs without trust_remote_code without modifying original dict."""
if "trust_remote_code" not in kwargs:
return kwargs
return {k: v for k, v in kwargs.items() if k != "trust_remote_code"}
def modelscope_list_repo_files(
repo_id: str,
revision: str | None = None,