Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
fix(studio): report why a model's security checks blocked it (#16292)
Long Yixing9684fb3d2df9
diff --git a/studio/backend/core/export/worker.py b/studio/backend/core/export/worker.pyindex 495875e70b5..e229f7273ac 100644--- a/studio/backend/core/export/worker.py+++ b/studio/backend/core/export/worker.py@@ -326,11 +326,7 @@ def _run_export_security_gates({"type": "loaded","success": False,- "message": (- f"Checkpoint '{_rc.model_name}' ships custom code flagged as "- f"{_rc.max_severity} by the security scan. Review and "- f"approve it to proceed."- ),+ "message": _rc.blocked_message("Checkpoint"),"error_kind": "remote_code_blocked","remote_code": _rc.response_payload(),"ts": time.time(),diff --git a/studio/backend/core/inference/worker.py b/studio/backend/core/inference/worker.pyindex 27abaa7b057..91b2e4bf7e4 100644--- a/studio/backend/core/inference/worker.py+++ b/studio/backend/core/inference/worker.py@@ -519,11 +519,7 @@ def _run_security_gates({"type": "loaded","success": False,- "message": (- f"Model '{_rc.model_name}' ships custom code flagged as "- f"{_rc.max_severity} by the security scan. Review "- f"and approve it to proceed."- ),+ "message": _rc.blocked_message(),"error_kind": "remote_code_blocked","remote_code": _rc.response_payload(),},diff --git a/studio/backend/core/training/worker.py b/studio/backend/core/training/worker.pyindex ac9e09d0ede..cd69301baf9 100644--- a/studio/backend/core/training/worker.py+++ b/studio/backend/core/training/worker.py@@ -1127,9 +1127,9 @@ def _model_load_security_error(config: dict, load_target: str, hf_token: str | Nreturn Nonereturn {"error": (- f"Model '{decision.model_name}' ships custom code flagged as "- f"{decision.max_severity} by the security scan. Review it and "- f"re-run with approval to proceed.\n\n{decision.findings_summary}"+ f"{decision.blocked_message()}\n\n{decision.findings_summary}"+ if decision.max_severity+ else decision.blocked_message()),"error_kind": "remote_code_blocked","remote_code": decision.response_payload(),diff --git a/studio/backend/routes/models.py b/studio/backend/routes/models.pyindex 0b670310242..3a53909687b 100644--- a/studio/backend/routes/models.py+++ b/studio/backend/routes/models.py@@ -2811,6 +2811,11 @@ async def scan_model_remote_code(load_subdirs_by_target = consent_load_subdirs,)payload = decision.response_payload()+ blocks = (+ [(payload.get("block_cause"), payload.get("model_name"))]+ if payload.get("block_cause")+ else []+ )payload["model_name"] = exact_snapshot_repo_id if exact_snapshot_path else model_namepayload["requires_trust_remote_code"] = decision.has_remote_code# Prior approval lets the dialog be skipped; the scan still ran, so this is a real match.@@ -2841,6 +2846,8 @@ async def scan_model_remote_code()security_blocked = security_blocked or _sec.blockedunsafe_files.extend(_sec.unsafe_files)+ if _sec.blocked:+ blocks.append((_sec.block_cause, _sec.model_name))payload["unsafe_files"] = unsafe_filespayload["security_blocked"] = security_blockedif security_blocked:@@ -2848,6 +2855,16 @@ async def scan_model_remote_code(payload["approvable"] = Falsepayload["requires_trust_remote_code"] = Truepayload["error_kind"] = "malware_blocked"+ from utils.hub_settings import active_source_label+ from utils.security.file_security import NOT_ON_SOURCE, strongest_block++ block_cause, block_target = strongest_block(blocks)+ payload["block_cause"] = block_cause+ # A repo the source lacks declares nothing, but the load still stops at the dialog.+ if block_cause:+ payload["requires_trust_remote_code"] = True+ payload["block_source"] = active_source_label()+ payload["block_target"] = block_target if block_cause == NOT_ON_SOURCE else None# The findings quote paths inside the model directory.from hub.utils.host_paths import restore_inventory_handlesdiff --git a/studio/backend/tests/test_consent_gate.py b/studio/backend/tests/test_consent_gate.pyindex 241800b6608..8f5a5c24e3c 100644--- a/studio/backend/tests/test_consent_gate.py+++ b/studio/backend/tests/test_consent_gate.py@@ -479,6 +479,153 @@ class TestConsentGate:)assert d1.fingerprint != d2.fingerprint+ @staticmethod+ def _gate_with_unreachable_repo(+ config_state = None,+ probe_error = None,+ snapshot = None,+ ):+ real_config, real_files = consent._config_has_auto_map, consent.repo_remote_code_files++ def files(name, **kwargs):+ if name == "x/y":+ raise RemoteCodeUnscannable("404")+ return real_files(name, **kwargs)++ with (+ patch.object(+ consent,+ "_config_has_auto_map",+ side_effect = lambda n, *a, **k: config_state+ if n == "x/y"+ else real_config(n, *a, **k),+ ),+ patch.object(consent, "repo_remote_code_files", side_effect = files),+ patch("huggingface_hub.HfApi.model_info", side_effect = probe_error or OSError("down")),+ patch("utils.utils.hf_cache_snapshot_dir_for_repo", return_value = snapshot),+ ):+ return evaluate_remote_code_consent("x/y", trust_remote_code = True)++ @staticmethod+ def _repo_not_found():+ from huggingface_hub.errors import RepositoryNotFoundError+ response = SimpleNamespace(status_code = 404, headers = {}, url = "u", request = None)+ return RepositoryNotFoundError("404", response = response)++ def test_repo_missing_from_source_is_blocked_without_claiming_code(self, monkeypatch):+ monkeypatch.setenv("UNSLOTH_STUDIO_HUB_SOURCE", "modelscope")+ d = self._gate_with_unreachable_repo(probe_error = self._repo_not_found())+ assert d.has_remote_code is False+ assert d.blocked is True and d.approvable is False+ assert d.block_cause == "not_on_source"+ assert "not on ModelScope" in d.blocked_message()+ assert "flagged" not in d.blocked_message()++ @pytest.mark.parametrize(+ ("source", "has_code", "expected"),+ [+ ("modelscope", False, (False, False, None)),+ ("modelscope", True, (True, True, "critical_findings")),+ ("huggingface", False, (False, True, "not_on_source")),+ ],+ )+ def test_repo_missing_from_source_judges_the_cached_snapshot(+ self, monkeypatch, tmp_path, source, has_code, expected+ ):+ config = {"auto_map": {"AutoModel": "modeling_backdoor.M"}} if has_code else {}+ (tmp_path / "config.json").write_text(json.dumps(config), encoding = "utf-8")+ if has_code:+ (tmp_path / "modeling_backdoor.py").write_text(+ _CRITICAL["modeling_backdoor.py"], encoding = "utf-8"+ )+ monkeypatch.setenv("UNSLOTH_STUDIO_HUB_SOURCE", source)+ d = self._gate_with_unreachable_repo(probe_error = self._repo_not_found(), snapshot = tmp_path)+ assert (d.has_remote_code, d.blocked, d.block_cause) == expected++ def test_declared_code_stays_code_even_when_the_repo_answers_404(self):+ d = self._gate_with_unreachable_repo(True, self._repo_not_found())+ assert d.has_remote_code is True and d.blocked is True+ assert d.block_cause == "unscannable"+ assert "present" in d.findings_summary++ def test_unreadable_repo_does_not_claim_declared_code(self):+ d = self._gate_with_unreachable_repo()+ assert d.has_remote_code is True and d.blocked is True and d.approvable is False+ assert d.block_cause == "unscannable"+ assert "present" not in d.findings_summary+ assert "flagged" not in d.blocked_message()++ def test_block_cause_and_message_follow_the_scan(self):+ a, b = _with_auto_map(_CRITICAL)+ with a, b:+ d = evaluate_remote_code_consent("x/y", trust_remote_code = True)+ assert d.max_severity == "CRITICAL" and d.block_cause == "critical_findings"+ assert d.blocked_message("Checkpoint").startswith("Checkpoint 'x/y' ships custom code")++ def test_managed_refusal_says_so_rather_than_flagged(self):+ a, b = _with_auto_map({"a.py": "x = 1\n"})+ with a, b, patch.object(consent, "managed_remote_code_refused", return_value = True):+ d = evaluate_remote_code_consent("x/y", trust_remote_code = True)+ assert d.block_cause == "managed_refused"+ assert d.blocked_message() == consent.MANAGED_REMOTE_CODE_REFUSAL++ def test_scan_route_reports_the_cause_and_keeps_the_dialog_open(self, monkeypatch):+ import asyncio++ models_route = _load_models_route(monkeypatch)+ import utils.models.model_config as model_config+ import utils.security as security+ import utils.security.remote_code_scan as remote_code_scan++ monkeypatch.setenv("UNSLOTH_STUDIO_HUB_SOURCE", "modelscope")+ monkeypatch.setattr(models_route, "is_local_path", lambda _v: False)+ monkeypatch.setattr(models_route, "resolve_cached_repo_id_case", lambda v: v)+ monkeypatch.setattr(models_route, "cached_read_refused", lambda *_a, **_k: False)+ monkeypatch.setattr(models_route, "_repo_in_any_hf_cache", lambda *_a: False)+ monkeypatch.setattr(models_route, "anonymous_and_offline", lambda *_a, **_k: False)+ monkeypatch.setattr(+ model_config, "get_base_model_from_lora_identifier", lambda *_a, **_k: None+ )+ monkeypatch.setattr(remote_code_scan, "external_auto_map_repos", lambda *_a, **_k: set())+ monkeypatch.setattr(security, "security_load_subdirs", lambda *_a: ())++ def scan(has_code, severity, code_cause, file_cause):+ rc = consent.RemoteCodeDecision(+ "x/y",+ has_code,+ bool(code_cause),+ None,+ severity,+ "",+ "r",+ approvable = not code_cause,+ block_cause = code_cause,+ )+ files = security.FileSecurityDecision("x/y", bool(file_cause), block_cause = file_cause)+ monkeypatch.setattr(+ security, "preflight_remote_code_consent_for_targets", lambda *_a, **_k: rc+ )+ monkeypatch.setattr(security, "evaluate_file_security", lambda *_a, **_k: files)+ return asyncio.run(+ models_route.scan_model_remote_code(+ model_name = "x/y", hf_token = None, current_subject = "tester"+ )+ )++ payload = scan(False, None, "not_on_source", None)+ assert payload["requires_trust_remote_code"] is True and payload["approvable"] is False+ assert payload["block_cause"] == "not_on_source"+ assert payload["block_source"] == "ModelScope" and payload["block_target"] == "x/y"++ payload = scan(True, "CRITICAL", "critical_findings", "not_on_source")+ assert payload["block_cause"] == "critical_findings" and payload["block_target"] is None++ payload = scan(False, None, None, "not_on_source")+ assert payload["block_cause"] == "not_on_source"++ payload = scan(False, None, None, None)+ assert payload["block_cause"] is None and payload["requires_trust_remote_code"] is False+def test_unscannable_auto_map_blocked_fail_closed(self):with (patch.object(consent, "_config_has_auto_map", return_value = True),diff --git a/studio/backend/tests/test_export_ssm_kernels.py b/studio/backend/tests/test_export_ssm_kernels.pyindex 3685fe45fd3..9c98550ab15 100644--- a/studio/backend/tests/test_export_ssm_kernels.py+++ b/studio/backend/tests/test_export_ssm_kernels.py@@ -274,6 +274,9 @@ class _Verdict:self.model_name = "acme/evil"self.max_severity = "CRITICAL"+ def blocked_message(self, _subject = "Model"):+ return "flagged CRITICAL"+def response_payload(self):return {"blocked": self.blocked}diff --git a/studio/backend/tests/test_file_security.py b/studio/backend/tests/test_file_security.pyindex 47e324bb964..953f1768b2c 100644--- a/studio/backend/tests/test_file_security.py+++ b/studio/backend/tests/test_file_security.py@@ -342,7 +342,7 @@ def test_response_payload_shape():status = {"scansDone": True, "filesWithIssues": [{"path": "a.pkl", "level": "malicious"}]}with _patch_status(status):payload = evaluate_file_security("evil/repo").response_payload()- assert set(payload) == {"unsafe_files", "security_blocked", "reason"}+ assert set(payload) == {"unsafe_files", "security_blocked", "reason", "block_cause"}assert payload["security_blocked"] is Trueassert payload["unsafe_files"] == [{"path": "a.pkl", "level": "malicious"}]@@ -663,6 +663,86 @@ def test_modelscope_has_no_scan_so_pickle_weights_fail_closed(monkeypatch, filesassert "Switch the model source to Hugging Face" in d.reason+def _hub_error(cls):+ response = SimpleNamespace(status_code = 404, headers = {}, url = "http://adapter", request = None)+ return cls("404", response = response)+++def test_modelscope_missing_repo_blocks_and_names_the_source(monkeypatch):+ from huggingface_hub.errors import GatedRepoError, RepositoryNotFoundError++ monkeypatch.setenv("UNSLOTH_STUDIO_HUB_SOURCE", "modelscope")+ with (+ _patch_status(None),+ patch(+ "huggingface_hub.HfApi.list_repo_files",+ side_effect = _hub_error(RepositoryNotFoundError),+ ),+ ):+ decision = evaluate_file_security("x/y")+ assert decision.blocked is True+ assert decision.block_cause == "not_on_source"+ assert "not on ModelScope" in decision.reason and "Hugging Face" in decision.reason++ # A gated repo exists, so it stays "could not check".+ with (+ _patch_status(None),+ patch("huggingface_hub.HfApi.list_repo_files", side_effect = _hub_error(GatedRepoError)),+ ):+ decision = evaluate_file_security("x/y")+ assert decision.blocked is True+ assert decision.block_cause == "unscannable"+++ ("weight", "blocked", "cause"),+ [("model.safetensors", False, None), ("pytorch_model.bin", True, "unscanned_weights")],+)+def test_modelscope_missing_repo_judges_the_cached_snapshot(+ monkeypatch, tmp_path, weight, blocked, cause+):+ from huggingface_hub.errors import RepositoryNotFoundError++ (tmp_path / weight).write_bytes(b"x")+ monkeypatch.setenv("UNSLOTH_STUDIO_HUB_SOURCE", "modelscope")+ with (+ _patch_status(None),+ patch(+ "huggingface_hub.HfApi.list_repo_files",+ side_effect = _hub_error(RepositoryNotFoundError),+ ),+ patch("utils.utils.hf_cache_snapshot_dir_for_repo", return_value = tmp_path),+ ):+ decision = evaluate_file_security("x/y")+ assert decision.blocked is blocked+ assert decision.block_cause == cause+++def test_each_block_names_its_cause(monkeypatch, tmp_path):+ with _patch_status({"filesWithIssues": [{"path": "model.pkl", "level": "unsafe"}]}):+ assert evaluate_file_security("x/y").block_cause == "unsafe_files"+ monkeypatch.setenv("UNSLOTH_STUDIO_HUB_SOURCE", "modelscope")+ with (+ _patch_status(None),+ patch("huggingface_hub.HfApi.list_repo_files", return_value = ["pytorch_model.bin"]),+ ):+ assert evaluate_file_security("x/y").block_cause == "unscanned_weights"+ snapshot = tmp_path / "models--x--y" / "snapshots" / "abc"+ snapshot.mkdir(parents = True)+ (snapshot / "pytorch_model.bin").write_bytes(b"x")+ with _patch_status(None):+ assert evaluate_file_security(str(snapshot)).block_cause == "unscanned_weights"+++def test_strongest_block_prefers_a_finding_over_a_failed_check():+ from utils.security.file_security import strongest_block++ assert strongest_block([]) == (None, None)+ assert strongest_block([("not_on_source", "a"), ("critical_findings", "b")])[1] == "b"+ assert strongest_block([("critical_findings", "a"), ("unsafe_files", "b")])[1] == "b"+ assert strongest_block([(None, "a")]) == ("unscannable", "a")++def test_modelscope_listing_failure_blocks(monkeypatch):monkeypatch.setenv("UNSLOTH_STUDIO_HUB_SOURCE", "modelscope")with (diff --git a/studio/backend/utils/hf_probe.py b/studio/backend/utils/hf_probe.pyindex 4fd9e8a5225..7cbde70928b 100644--- a/studio/backend/utils/hf_probe.py+++ b/studio/backend/utils/hf_probe.py@@ -47,3 +47,37 @@ def hf_file_definitely_absent(logger.debug("Could not probe %s for %s: %s", repo_id, filename, exc)return Falsereturn False+++def is_repo_not_found(exc: BaseException) -> bool:+ """A gated repo subclasses this error but exists."""+ from huggingface_hub.errors import GatedRepoError, RepositoryNotFoundError+ return isinstance(exc, RepositoryNotFoundError) and not isinstance(exc, GatedRepoError)+++def hub_repo_not_found(repo_id: str, token: Optional[str] = None) -> bool:+ """True only when the active source answers that it has no such repo for this caller; any+ other failure is no answer."""+ try:+ from huggingface_hub import HfApi++ from hub.utils.hf_tokens import call_with_anonymous_retry+ call_with_anonymous_retry(+ lambda sent: HfApi().model_info(repo_id, token = sent, timeout = 10.0), token+ )+ except Exception as exc: # noqa: BLE001 - no answer is not an answer of "absent"+ return is_repo_not_found(exc)+ return False+++def repo_not_found_message(repo_id: str) -> str:+ from utils.hub_settings import MODELSCOPE, active_source+ if active_source() == MODELSCOPE:+ return (+ f"{repo_id} is not on ModelScope. "+ "Switch the model source to Hugging Face in Settings to use it."+ )+ return (+ f"{repo_id} was not found on Hugging Face. "+ "Check the name, or set a token with access if the repository is private."+ )diff --git a/studio/backend/utils/hub_settings.py b/studio/backend/utils/hub_settings.pyindex d946d955398..c99e9fd6859 100644--- a/studio/backend/utils/hub_settings.py+++ b/studio/backend/utils/hub_settings.py@@ -137,6 +137,10 @@ def active_source() -> str:return MODELSCOPE if os.environ.get(SOURCE_ENV) == MODELSCOPE else HUGGINGFACE+def active_source_label() -> str:+ return "ModelScope" if active_source() == MODELSCOPE else "Hugging Face"++def hugging_face_endpoint() -> str:"""The Hugging Face endpoint the settings select, also while ModelScope serves."""return (get_hub_settings().hf_endpoint or DEFAULTS_BY_HEALTH_KEY["hf_endpoint"]).rstrip("/")diff --git a/studio/backend/utils/security/consent.py b/studio/backend/utils/security/consent.pyindex 2f0d8f8b14e..e10772872dc 100644--- a/studio/backend/utils/security/consent.py+++ b/studio/backend/utils/security/consent.py@@ -10,6 +10,12 @@ from typing import Optionalfrom loggers import get_loggerfrom utils.account_context import is_owner_context+from utils.security.file_security import (+ CRITICAL_FINDINGS,+ MANAGED_REFUSED,+ NOT_ON_SOURCE,+ UNSCANNABLE,+)from utils.security.remote_code_scan import (CRITICAL,HIGH,@@ -51,11 +57,22 @@ class RemoteCodeDecision:findings_summary: strreason: strfindings: list = field(default_factory = list)- approvable: bool = True # False only for CRITICAL (user cannot override)+ approvable: bool = True # False for a hard block (user cannot override)+ block_cause: Optional[str] = None++ def blocked_message(self, subject: str = "Model") -> str:+ """Only a scan that ran can have flagged anything; other blocks state their own cause."""+ if self.max_severity:+ return (+ f"{subject} '{self.model_name}' ships custom code flagged as "+ f"{self.max_severity} by the security scan. Review and approve it to proceed."+ )+ return self.findings_summary or self.reasondef response_payload(self) -> dict:- """Machine-readable detail for the frontend. ``error_kind`` splits a user-approvable prompt (``remote_code_consent_required``) from a CRITICAL hard block (``remote_code_blocked``)."""+ """Machine-readable detail for the frontend. ``error_kind`` splits a user-approvable prompt (``remote_code_consent_required``) from a hard block (``remote_code_blocked``), whose ``block_cause`` says why."""return {+ "block_cause": self.block_cause,"error_kind": ("remote_code_consent_required" if self.approvable else "remote_code_blocked"),@@ -165,6 +182,52 @@ def _load_remote_code_configs(return None+def _unscannable_decision(target: str, *, declared: bool, missing: bool) -> RemoteCodeDecision:+ """Fails closed either way; only a declaration read from a config says the repo has code."""+ from utils.hf_probe import repo_not_found_message+ from utils.hub_settings import active_source_label++ if not declared and missing:+ logger.warning(+ "Blocking load of '%s': the repo was not found on %s, so it could not be scanned.",+ target,+ active_source_label(),+ )+ return RemoteCodeDecision(+ target,+ False,+ True,+ None,+ None,+ repo_not_found_message(target),+ "blocked: repo not found on the model source",+ approvable = False,+ block_cause = NOT_ON_SOURCE,+ )+ logger.warning(+ "Blocking trust_remote_code load of '%s': %s could not be downloaded and scanned.",+ target,+ "remote code present (auto_map) but it" if declared else "its configs or code",+ )+ return RemoteCodeDecision(+ target,+ True,+ True,+ None,+ None,+ (+ "Remote code is present (auto_map) but could not be downloaded and scanned."+ if declared+ else f"Could not read this model from {active_source_label()} to check it for "+ "custom code, so it could not be downloaded and scanned."+ )+ + " Retry when the repo is reachable and the correct token is set.",+ "blocked: remote code could not be scanned",+ approvable = False,+ block_cause = UNSCANNABLE,+ )++def evaluate_remote_code_consent(model_name: str,hf_token: Optional[str] = None,@@ -237,29 +300,36 @@ def evaluate_remote_code_consent_for_targets(for target in targets:load_subdirs = tuple(load_subdirs_by_target.get(target, ()))scan_kwargs = {"load_subdirs": load_subdirs} if load_subdirs else {}- if _config_has_auto_map(target, hf_token, **scan_kwargs) is False:+ declares_code = _config_has_auto_map(target, hf_token, **scan_kwargs)+ if declares_code is False:continue- has_remote_code = Truetry:files = repo_remote_code_files(target, hf_token = hf_token, **scan_kwargs)except RemoteCodeUnscannable:- logger.warning(- "Blocking trust_remote_code load of '%s': remote code present (auto_map) "- "but could not be downloaded and scanned.",- target,- )- return RemoteCodeDecision(- target,- True,- True,- None,- None,- "Remote code is present (auto_map) but could not be downloaded and "- "scanned. Retry when the repo is reachable and the correct Hugging Face "- "token is set.",- "blocked: remote code could not be scanned",- approvable = False,+ from utils.hf_probe import hub_repo_not_found+ from utils.hub_settings import MODELSCOPE, active_source+ from utils.paths import is_local_path+ from utils.utils import hf_cache_snapshot_dir_for_repo++ declared = declares_code is True+ on_modelscope = active_source() == MODELSCOPE+ missing = (+ (on_modelscope or not declared)+ and not is_local_path(target)+ and hub_repo_not_found(target, hf_token))+ # Hugging Face's 404 may only mean private to this caller, so only ModelScope's counts.+ snapshot = hf_cache_snapshot_dir_for_repo(target) if missing and on_modelscope else None+ if snapshot is None:+ return _unscannable_decision(target, declared = declared, missing = missing)+ # The hub falls back to this snapshot on a 404, so judge what it holds.+ if _config_has_auto_map(str(snapshot), hf_token, **scan_kwargs) is False:+ continue+ try:+ files = repo_remote_code_files(str(snapshot), hf_token = hf_token, **scan_kwargs)+ except RemoteCodeUnscannable:+ return _unscannable_decision(target, declared = True, missing = False)+ has_remote_code = True# Namespace filenames by (casing-normalized) target so two repos' same-named files stay distinct.target_key = _fingerprint_target_key(target)for filename, body in files.items():@@ -284,7 +354,15 @@ def evaluate_remote_code_consent_for_targets(if managed_remote_code_refused():return RemoteCodeDecision(- primary, True, True, None, None, "", MANAGED_REMOTE_CODE_REFUSAL, approvable = False+ primary,+ True,+ True,+ None,+ None,+ "",+ MANAGED_REMOTE_CODE_REFUSAL,+ approvable = False,+ block_cause = MANAGED_REFUSED,)result = scan_remote_code_files(combined)@@ -340,4 +418,5 @@ def evaluate_remote_code_consent_for_targets(reason,findings = result.findings_payload(),approvable = approvable,+ block_cause = CRITICAL_FINDINGS if sev == CRITICAL else None,)diff --git a/studio/backend/utils/security/file_security.py b/studio/backend/utils/security/file_security.pyindex cf95acfa205..a91a3c255f2 100644--- a/studio/backend/utils/security/file_security.py+++ b/studio/backend/utils/security/file_security.py@@ -313,6 +313,31 @@ def _indexed_shard_paths(_REQUEST_TIMEOUT = 10.0_RETRY_TIMEOUT = 20.0+# Why a load is hard-blocked, strongest first: a finding outranks a check that could not run.+UNSAFE_FILES = "unsafe_files"+CRITICAL_FINDINGS = "critical_findings"+UNSCANNED_WEIGHTS = "unscanned_weights"+MANAGED_REFUSED = "managed_refused"+NOT_ON_SOURCE = "not_on_source"+UNSCANNABLE = "unscannable"+_BLOCK_CAUSES = (+ UNSAFE_FILES,+ CRITICAL_FINDINGS,+ UNSCANNED_WEIGHTS,+ MANAGED_REFUSED,+ NOT_ON_SOURCE,+ UNSCANNABLE,+)+++def strongest_block(blocks: list) -> tuple:+ """The ``(cause, target)`` to report from every gate's block; an unnamed cause is unscannable."""+ return min(+ ((cause if cause in _BLOCK_CAUSES else UNSCANNABLE, target) for cause, target in blocks),+ key = lambda block: _BLOCK_CAUSES.index(block[0]),+ default = (None, None),+ )+@dataclassclass FileSecurityDecision:@@ -322,6 +347,7 @@ class FileSecurityDecision:blocked: boolunsafe_files: list = field(default_factory = list)reason: str = ""+ block_cause: Optional[str] = Nonedef response_payload(self) -> dict:"""Machine-readable detail merged into the preflight payload the dialog reads."""@@ -329,6 +355,7 @@ class FileSecurityDecision:"unsafe_files": self.unsafe_files,"security_blocked": self.blocked,"reason": self.reason,+ "block_cause": self.block_cause,}@@ -553,6 +580,7 @@ def _evaluate_local_snapshot(model_name,True,reason = f"{context}; could not inspect the local cache",+ block_cause = UNSCANNABLE,)else:try:@@ -570,6 +598,7 @@ def _evaluate_local_snapshot(model_name,True,reason = f"{context}; could not inspect the selected model snapshot",+ block_cause = UNSCANNABLE,)if snapshot is None:@@ -591,6 +620,7 @@ def _evaluate_local_snapshot(model_name,True,reason = f"{context}; could not read the local cache",+ block_cause = UNSCANNABLE,)if not pickles:@@ -615,6 +645,7 @@ def _evaluate_local_snapshot(True,unsafe_files = [{"path": rel, "level": "unscanned"} for rel in rel_paths],reason = (f"{context}; unscanned pickle weights with no safetensors alternative: {names}"),+ block_cause = UNSCANNED_WEIGHTS,)@@ -637,12 +668,33 @@ def _evaluate_unscanned_listing(try:from huggingface_hub import HfApifiles = HfApi().list_repo_files(model_name, token = hf_token or False)- except Exception:+ except Exception as exc:+ from utils.hf_probe import is_repo_not_found, repo_not_found_message++ if is_repo_not_found(exc):+ from utils.utils import hf_cache_snapshot_dir_for_repo++ # The hub falls back to this snapshot, so its weights are what a load would read.+ snapshot = hf_cache_snapshot_dir_for_repo(model_name)+ if snapshot is not None:+ return _evaluate_local_snapshot(+ model_name, snapshot, context = context, load_subdirs = load_subdirs+ )+ logger.warning("Blocking load of '%s': it is not on ModelScope.", model_name)+ return FileSecurityDecision(+ model_name,+ True,+ reason = repo_not_found_message(model_name),+ block_cause = NOT_ON_SOURCE,+ )logger.warning("Blocking load of '%s': %s and its files could not be listed.", model_name, context)return FileSecurityDecision(- model_name, True, reason = f"{context}; could not list the repository"+ model_name,+ True,+ reason = f"{context}; could not list the repository",+ block_cause = UNSCANNABLE,)by_dir: dict[str, set] = {}for path in files:@@ -679,6 +731,7 @@ def _evaluate_unscanned_listing(f"{context}; unscanned pickle weights with no safetensors alternative: {listed}. ""Switch the model source to Hugging Face in Settings to load it."),+ block_cause = UNSCANNED_WEIGHTS,)@@ -800,4 +853,5 @@ def evaluate_file_security(True,unsafe_files = unsafe,reason = f"Hugging Face security scan flagged unsafe files: {names}",+ block_cause = UNSAFE_FILES,)diff --git a/studio/frontend/src/features/security/api/remote-code-api.ts b/studio/frontend/src/features/security/api/remote-code-api.tsindex d1260607252..8c8fc7c5c5f 100644--- a/studio/frontend/src/features/security/api/remote-code-api.ts+++ b/studio/frontend/src/features/security/api/remote-code-api.ts@@ -4,6 +4,7 @@import { authFetch } from "@/features/auth";import { readFastApiError } from "@/lib/format-fastapi-error";import type {+ RemoteCodeBlockCause,RemoteCodeFinding,RemoteCodeScan,RemoteCodeSeverity,@@ -20,6 +21,9 @@ interface SnippetRowResponse {}interface RemoteCodeScanResponse {+ block_cause?: string | null;+ block_source?: string;+ block_target?: string | null;requires_trust_remote_code?: boolean;has_remote_code?: boolean;approvable?: boolean;@@ -91,6 +95,9 @@ export async function getRemoteCodeScan(level: u.level ?? "unsafe",}));return {+ blockCause: (data.block_cause as RemoteCodeBlockCause | null) ?? null,+ blockSource: data.block_source ?? "Hugging Face",+ blockTarget: data.block_target ?? null,requiresTrustRemoteCode: Boolean(data.requires_trust_remote_code ?? data.has_remote_code,),diff --git a/studio/frontend/src/features/security/components/remote-code-consent-dialog.tsx b/studio/frontend/src/features/security/components/remote-code-consent-dialog.tsxindex 99b216d41e6..d16b32ba302 100644--- a/studio/frontend/src/features/security/components/remote-code-consent-dialog.tsx+++ b/studio/frontend/src/features/security/components/remote-code-consent-dialog.tsx@@ -21,6 +21,7 @@ import {} from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";import { Fragment, type ReactNode } from "react";+import { blockCopy } from "../lib/block-copy";import { severityTone } from "../lib/severity-tone";import { useRemoteCodeConsentDialogStore } from "../stores/remote-code-consent-dialog-store";import type {@@ -183,13 +184,18 @@ export function RemoteCodeConsentDialog() {const resolve = useRemoteCodeConsentDialogStore((s) => s.resolve);const t = useT();- const displayName = modelDisplayName(scan?.modelName) ?? t("remoteCode.thisModel");+ const displayName =+ modelDisplayName(scan?.blockTarget ?? scan?.modelName) ?? t("remoteCode.thisModel");const provider = scan?.provider ?? null;const blocked = scan ? !scan.approvable : false;const findings = scan?.findings ?? [];const unsafeFiles = scan?.unsafeFiles ?? [];- const malware = unsafeFiles.length > 0;+ const source = scan?.blockSource ?? "Hugging Face";+ const block = blocked+ ? blockCopy(scan?.blockCause ?? null, source, Boolean(provider))+ : null;const slots = {+ source,model: <span className="font-medium text-foreground">{displayName}</span>,provider: <span className="font-medium text-foreground">"{provider}"</span>,};@@ -226,42 +232,37 @@ export function RemoteCodeConsentDialog() {<div className="min-w-0 flex-1 space-y-3"><div className="space-y-1"><AlertDialogTitle>- {malware- ? t("remoteCode.unsafeTitle")- : blocked- ? t("remoteCode.blockedTitle")- : t("remoteCode.enableTitle")}+ {block+ ? t(block.title, { source })+ : t("remoteCode.enableTitle")}</AlertDialogTitle><AlertDialogDescription>- {malware ? (- fillSlots(- provider- ? t("remoteCode.unsafeBodyFromProvider")- : t("remoteCode.unsafeBody"),- slots,- )- ) : (- fillSlots(- provider+ {fillSlots(+ block+ ? t(block.body)+ : provider? t("remoteCode.customCodeFromProvider"): t("remoteCode.customCode"),- {- ...slots,- note: blocked- ? t("remoteCode.blockedNote")- : findings.length > 0- ? t("remoteCode.reviewNote")- : t("remoteCode.trustNote"),- },- )+ {+ ...slots,+ note: block+ ? block.note+ ? t(block.note)+ : ""+ : findings.length > 0+ ? t("remoteCode.reviewNote")+ : t("remoteCode.trustNote"),+ },)}</AlertDialogDescription></div>- {malware ? (+ {unsafeFiles.length > 0 ? (<div className="min-w-0 space-y-2"><p className="text-xs font-medium text-muted-foreground">- {t("remoteCode.flaggedIntro")}+ {scan?.blockCause === "unsafe_files"+ ? t("remoteCode.flaggedIntro")+ : t("remoteCode.unscannedIntro")}</p><div className="max-h-[calc(14rem*var(--ui-space-scale,1))] min-w-0 space-y-2 overflow-y-auto pr-1">{unsafeFiles.map((f, i) => (@@ -284,7 +285,7 @@ export function RemoteCodeConsentDialog() {</div>) : null}- {!malware && !blocked && findings.length === 0 ? (+ {!blocked && findings.length === 0 ? (<p className="text-xs text-muted-foreground">{t("remoteCode.nothingFlagged")}</p>diff --git a/studio/frontend/src/features/security/hooks/use-remote-code-consent.ts b/studio/frontend/src/features/security/hooks/use-remote-code-consent.tsindex fecd70b6bee..fa23fea7a31 100644--- a/studio/frontend/src/features/security/hooks/use-remote-code-consent.ts+++ b/studio/frontend/src/features/security/hooks/use-remote-code-consent.ts@@ -43,6 +43,9 @@ export async function confirmRemoteCodeIfNeeded({throw error;}scan = {+ blockCause: null,+ blockSource: "Hugging Face",+ blockTarget: null,requiresTrustRemoteCode: Boolean(requiresTrustRemoteCode),approvable: true,maxSeverity: null,diff --git a/studio/frontend/src/features/security/lib/block-copy.ts b/studio/frontend/src/features/security/lib/block-copy.tsnew file mode 100644index 00000000000..5bf81f169c1--- /dev/null+++ b/studio/frontend/src/features/security/lib/block-copy.ts@@ -0,0 +1,65 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++import type { TranslationKey } from "@/i18n";+import type { RemoteCodeBlockCause } from "../types";++export interface BlockCopy {+ title: TranslationKey;+ body: TranslationKey;+ note?: TranslationKey;+}++/** Only a scan that ran may claim findings; every other block says why no check could finish. */+export function blockCopy(+ cause: RemoteCodeBlockCause | null,+ source: string,+ hasProvider: boolean,+): BlockCopy {+ const onModelScope = source === "ModelScope";+ const customCode = hasProvider+ ? "remoteCode.customCodeFromProvider"+ : "remoteCode.customCode";+ switch (cause) {+ case "unsafe_files":+ return {+ title: "remoteCode.unsafeTitle",+ body: hasProvider+ ? "remoteCode.unsafeBodyFromProvider"+ : "remoteCode.unsafeBody",+ };+ case "critical_findings":+ return {+ title: "remoteCode.blockedTitle",+ body: customCode,+ note: "remoteCode.blockedNote",+ };+ case "unscanned_weights":+ return {+ title: "remoteCode.unscannedTitle",+ body: "remoteCode.unscannedBody",+ note: onModelScope+ ? "remoteCode.switchSourceNote"+ : "remoteCode.reconnectNote",+ };+ case "managed_refused":+ return {+ title: "remoteCode.managedTitle",+ body: customCode,+ note: "remoteCode.managedNote",+ };+ case "not_on_source":+ return {+ title: "remoteCode.notFoundTitle",+ body: onModelScope+ ? "remoteCode.notOnModelScopeBody"+ : "remoteCode.notFoundBody",+ };+ default:+ return {+ title: "remoteCode.checksFailedTitle",+ body: "remoteCode.checksFailedBody",+ note: onModelScope ? "remoteCode.switchSourceNote" : undefined,+ };+ }+}diff --git a/studio/frontend/src/features/security/types.ts b/studio/frontend/src/features/security/types.tsindex 0fd15525742..c0087b04e47 100644--- a/studio/frontend/src/features/security/types.ts+++ b/studio/frontend/src/features/security/types.ts@@ -25,7 +25,18 @@ export interface UnsafeFile {level: string;}+export type RemoteCodeBlockCause =+ | "unsafe_files"+ | "critical_findings"+ | "unscanned_weights"+ | "managed_refused"+ | "not_on_source"+ | "unscannable";+export interface RemoteCodeScan {+ blockCause: RemoteCodeBlockCause | null;+ blockSource: string;+ blockTarget: string | null;requiresTrustRemoteCode: boolean;approvable: boolean;maxSeverity: RemoteCodeSeverity | null;diff --git a/studio/frontend/src/i18n/locales/ar.ts b/studio/frontend/src/i18n/locales/ar.tsindex ff8fbe9cb59..03d97e5b84b 100644--- a/studio/frontend/src/i18n/locales/ar.ts+++ b/studio/frontend/src/i18n/locales/ar.ts@@ -5246,6 +5246,18 @@ export const ar = {flaggedIntro: "رصد الفاحص التلقائي لدينا مشكلات منها:",nothingFlagged:"لم يرصد الفاحص التلقائي لدينا أي ملفات مثيرة للقلق، لكن يُرجى التحقق مرة أخرى.",+ unscannedTitle: "تعذّر فحص ملفات النموذج",+ unscannedBody: "يتضمن {model} أوزان pickle يمكنها تشغيل التعليمات البرمجية عند التحميل، ولا يتوفر فحص للبرامج الضارة لها، لذا لا يمكن تحميله. {note}",+ unscannedIntro: "الملفات التي تعذّر فحصها:",+ switchSourceNote: "بدّل مصدر النماذج إلى Hugging Face في الإعدادات لتحميله.",+ reconnectNote: "اتصل بـ Hugging Face لتتمكن من قراءة نتيجة الفحص، ثم حاول مرة أخرى.",+ managedTitle: "التعليمات البرمجية المخصصة معطلة لهذا الحساب",+ managedNote: "إنها معطلة للحسابات المُدارة. اطلب من مالك التثبيت تفعيلها.",+ notFoundTitle: "غير موجود على {source}",+ notFoundBody: "لم يتم العثور على {model} على {source}، لذا تعذّر تشغيل فحوصات الأمان. تحقق من الاسم، أو عيّن رمزًا لديه صلاحية الوصول إذا كان المستودع خاصًا.",+ notOnModelScopeBody: "{model} غير متوفر على ModelScope، لذا تعذّر تشغيل فحوصات الأمان ولا يمكن تحميله من هناك. بدّل مصدر النماذج إلى Hugging Face في الإعدادات لاستخدامه.",+ checksFailedTitle: "تعذّر تشغيل فحوصات الأمان",+ checksFailedBody: "تعذّرت قراءة {model} من {source}، لذا تعذّر إكمال فحوصات الأمان ولا يمكن تحميله. تحقق من اتصالك ورمزك، ثم حاول مرة أخرى. {note}",enableAndContinue: "التفعيل والمتابعة",},tour: {diff --git a/studio/frontend/src/i18n/locales/cs.ts b/studio/frontend/src/i18n/locales/cs.tsindex 57dc1773f72..b1c7e3874a0 100644--- a/studio/frontend/src/i18n/locales/cs.ts+++ b/studio/frontend/src/i18n/locales/cs.ts@@ -5667,6 +5667,18 @@ export const cs = {flaggedIntro: "Náš automatický skener označil mimo jiné tyto problémy:",nothingFlagged:"Náš automatický skener neoznačil žádné znepokojivé soubory, přesto to prosím ověřte.",+ unscannedTitle: "Soubory modelu se nepodařilo zkontrolovat",+ unscannedBody: "{model} obsahuje váhy pickle, které mohou při načtení spustit kód, a kontrola malwaru pro ně není k dispozici, takže jej nelze načíst. {note}",+ unscannedIntro: "Soubory, které se nepodařilo zkontrolovat:",+ switchSourceNote: "Pro načtení přepněte zdroj modelů v Nastavení na Hugging Face.",+ reconnectNote: "Připojte se k Hugging Face, aby bylo možné načíst výsledek kontroly, a zkuste to znovu.",+ managedTitle: "Vlastní kód je pro tento účet vypnutý",+ managedNote: "Pro spravované účty je vypnutý. Požádejte vlastníka instalace o jeho zapnutí.",+ notFoundTitle: "Nenalezeno na {source}",+ notFoundBody: "{model} nebyl na {source} nalezen, takže bezpečnostní kontroly nemohly proběhnout. Zkontrolujte název, nebo nastavte token s přístupem, pokud je repozitář soukromý.",+ notOnModelScopeBody: "{model} není na ModelScope k dispozici, takže bezpečnostní kontroly nemohly proběhnout a odtud jej nelze načíst. Pro použití přepněte zdroj modelů v Nastavení na Hugging Face.",+ checksFailedTitle: "Bezpečnostní kontroly nemohly proběhnout",+ checksFailedBody: "{model} se nepodařilo načíst z {source}, takže bezpečnostní kontroly nemohly být dokončeny a nelze jej načíst. Zkontrolujte připojení a token a zkuste to znovu. {note}",enableAndContinue: "Povolit a pokračovat",},tour: {diff --git a/studio/frontend/src/i18n/locales/de.ts b/studio/frontend/src/i18n/locales/de.tsindex 7954a92f5be..fe51e7ee656 100644--- a/studio/frontend/src/i18n/locales/de.ts+++ b/studio/frontend/src/i18n/locales/de.ts@@ -5321,6 +5321,18 @@ export const de = {flaggedIntro: "Unser automatischer Scanner hat unter anderem folgende Probleme gefunden:",nothingFlagged:"Unser automatischer Scanner hat keine bedenklichen Dateien gefunden, aber bitte prüfen Sie es selbst noch einmal.",+ unscannedTitle: "Modelldateien konnten nicht geprüft werden",+ unscannedBody: "{model} enthält Pickle-Gewichte, die beim Laden Code ausführen können, und für sie ist kein Malware-Scan verfügbar. Das Modell kann daher nicht geladen werden. {note}",+ unscannedIntro: "Dateien, die nicht geprüft werden konnten:",+ switchSourceNote: "Wechsle in den Einstellungen die Modellquelle zu Hugging Face, um es zu laden.",+ reconnectNote: "Stelle eine Verbindung zu Hugging Face her, damit der Scan gelesen werden kann, und versuche es erneut.",+ managedTitle: "Benutzerdefinierter Code ist für dieses Konto deaktiviert",+ managedNote: "Er ist für verwaltete Konten deaktiviert. Bitte den Besitzer der Installation, ihn zu aktivieren.",+ notFoundTitle: "Nicht auf {source} gefunden",+ notFoundBody: "{model} wurde auf {source} nicht gefunden, daher konnten die Sicherheitsprüfungen nicht laufen. Prüfe den Namen oder lege ein Token mit Zugriff fest, falls das Repository privat ist.",+ notOnModelScopeBody: "{model} ist auf ModelScope nicht verfügbar, daher konnten die Sicherheitsprüfungen nicht laufen und es kann von dort nicht geladen werden. Wechsle in den Einstellungen die Modellquelle zu Hugging Face, um es zu verwenden.",+ checksFailedTitle: "Sicherheitsprüfungen konnten nicht laufen",+ checksFailedBody: "{model} konnte nicht von {source} gelesen werden. Die Sicherheitsprüfungen konnten daher nicht abgeschlossen werden und es kann nicht geladen werden. Prüfe deine Verbindung und dein Token und versuche es erneut. {note}",enableAndContinue: "Aktivieren und fortfahren",},tour: {diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.tsindex 578ee1615c8..8066c71655c 100644--- a/studio/frontend/src/i18n/locales/en.ts+++ b/studio/frontend/src/i18n/locales/en.ts@@ -5283,6 +5283,18 @@ export const en = {flaggedIntro: "Our automatic scanner flagged issues including:",nothingFlagged:"Our automatic scanner did not flag any worrying files, but please double check.",+ unscannedTitle: "Model files could not be scanned",+ unscannedBody: "{model} ships pickle weights, which can run code when they load, and no malware scan is available for them, so it cannot be loaded. {note}",+ unscannedIntro: "Files that could not be scanned:",+ switchSourceNote: "Switch the model source to Hugging Face in Settings to load it.",+ reconnectNote: "Connect to Hugging Face so its scan can be read, then try again.",+ managedTitle: "Custom code is off for this account",+ managedNote: "It is turned off for managed accounts. Ask the installation owner to enable it.",+ notFoundTitle: "Not found on {source}",+ notFoundBody: "{model} was not found on {source}, so its security checks could not run. Check the name, or set a token with access if the repository is private.",+ notOnModelScopeBody: "{model} is not available on ModelScope, so its security checks could not run and it cannot be loaded from there. Switch the model source to Hugging Face in Settings to use it.",+ checksFailedTitle: "Security checks could not run",+ checksFailedBody: "{model} could not be read from {source}, so its security checks could not finish and it cannot be loaded. Check your connection and token, then try again. {note}",enableAndContinue: "Enable and continue",},tour: {diff --git a/studio/frontend/src/i18n/locales/es-419.ts b/studio/frontend/src/i18n/locales/es-419.tsindex b58e9aee883..e07024b4926 100644--- a/studio/frontend/src/i18n/locales/es-419.ts+++ b/studio/frontend/src/i18n/locales/es-419.ts@@ -5737,6 +5737,18 @@ export const es419 = {"Nuestro analizador automático detectó problemas, entre ellos:",nothingFlagged:"Nuestro analizador automático no detectó archivos preocupantes, pero verifícalo tú también.",+ unscannedTitle: "No se pudieron analizar los archivos del modelo",+ unscannedBody: "{model} incluye pesos pickle, que pueden ejecutar código al cargarse, y no hay ningún análisis de malware disponible para ellos, por lo que no se puede cargar. {note}",+ unscannedIntro: "Archivos que no se pudieron analizar:",+ switchSourceNote: "Cambia la fuente de modelos a Hugging Face en Configuración para cargarlo.",+ reconnectNote: "Conéctate a Hugging Face para poder leer su análisis e inténtalo de nuevo.",+ managedTitle: "El código personalizado está desactivado en esta cuenta",+ managedNote: "Está desactivado en las cuentas administradas. Pídele al propietario de la instalación que lo active.",+ notFoundTitle: "No se encontró en {source}",+ notFoundBody: "{model} no se encontró en {source}, por lo que no se pudieron ejecutar sus comprobaciones de seguridad. Revisa el nombre o configura un token con acceso si el repositorio es privado.",+ notOnModelScopeBody: "{model} no está disponible en ModelScope, por lo que no se pudieron ejecutar sus comprobaciones de seguridad y no se puede cargar desde allí. Cambia la fuente de modelos a Hugging Face en Configuración para usarlo.",+ checksFailedTitle: "No se pudieron ejecutar las comprobaciones de seguridad",+ checksFailedBody: "No se pudo leer {model} desde {source}, así que sus comprobaciones de seguridad no pudieron terminar y no se puede cargar. Revisa tu conexión y tu token e inténtalo de nuevo. {note}",enableAndContinue: "Activar y continuar",},tour: {diff --git a/studio/frontend/src/i18n/locales/es.ts b/studio/frontend/src/i18n/locales/es.tsindex dfa79cf2df5..53a303eac69 100644--- a/studio/frontend/src/i18n/locales/es.ts+++ b/studio/frontend/src/i18n/locales/es.ts@@ -5320,6 +5320,18 @@ export const es = {flaggedIntro: "Nuestro analizador automático detectó problemas, entre ellos:",nothingFlagged:"Nuestro analizador automático no detectó archivos preocupantes, pero compruébalo tú también.",+ unscannedTitle: "No se pudieron analizar los archivos del modelo",+ unscannedBody: "{model} incluye pesos pickle, que pueden ejecutar código al cargarse, y no hay ningún análisis de malware disponible para ellos, por lo que no se puede cargar. {note}",+ unscannedIntro: "Archivos que no se pudieron analizar:",+ switchSourceNote: "Cambia la fuente de modelos a Hugging Face en Ajustes para cargarlo.",+ reconnectNote: "Conéctate a Hugging Face para poder leer su análisis e inténtalo de nuevo.",+ managedTitle: "El código personalizado está desactivado en esta cuenta",+ managedNote: "Está desactivado en las cuentas administradas. Pide al propietario de la instalación que lo active.",+ notFoundTitle: "No se encontró en {source}",+ notFoundBody: "{model} no se encontró en {source}, por lo que no se pudieron ejecutar sus comprobaciones de seguridad. Revisa el nombre o configura un token con acceso si el repositorio es privado.",+ notOnModelScopeBody: "{model} no está disponible en ModelScope, por lo que no se pudieron ejecutar sus comprobaciones de seguridad y no se puede cargar desde allí. Cambia la fuente de modelos a Hugging Face en Ajustes para usarlo.",+ checksFailedTitle: "No se pudieron ejecutar las comprobaciones de seguridad",+ checksFailedBody: "No se pudo leer {model} desde {source}, así que sus comprobaciones de seguridad no pudieron terminar y no se puede cargar. Revisa tu conexión y tu token e inténtalo de nuevo. {note}",enableAndContinue: "Habilitar y continuar",},tour: {diff --git a/studio/frontend/src/i18n/locales/fa.ts b/studio/frontend/src/i18n/locales/fa.tsindex 484427fe76e..e268b6cbd8e 100644--- a/studio/frontend/src/i18n/locales/fa.ts+++ b/studio/frontend/src/i18n/locales/fa.ts@@ -5619,6 +5619,18 @@ export const fa = {"اسکنر خودکار ما مشکلاتی از جمله موارد زیر را شناسایی کرده است:",nothingFlagged:"اسکنر خودکار ما هیچ فایل نگرانکنندهای شناسایی نکرد، اما لطفاً دوباره بررسی کنید.",+ unscannedTitle: "فایلهای مدل اسکن نشدند",+ unscannedBody: "{model} شامل وزنهای pickle است که هنگام بارگذاری میتوانند کد اجرا کنند و اسکن بدافزار برای آنها در دسترس نیست، بنابراین بارگذاری نمیشود. {note}",+ unscannedIntro: "فایلهایی که اسکن نشدند:",+ switchSourceNote: "برای بارگذاری، منبع مدل را در تنظیمات به Hugging Face تغییر دهید.",+ reconnectNote: "به Hugging Face متصل شوید تا نتیجهٔ اسکن خوانده شود، سپس دوباره تلاش کنید.",+ managedTitle: "کد سفارشی برای این حساب خاموش است",+ managedNote: "برای حسابهای مدیریتشده خاموش است. از مالک نصب بخواهید آن را فعال کند.",+ notFoundTitle: "در {source} پیدا نشد",+ notFoundBody: "{model} در {source} پیدا نشد، بنابراین بررسیهای امنیتی اجرا نشدند. نام را بررسی کنید یا اگر مخزن خصوصی است، توکنی با دسترسی تنظیم کنید.",+ notOnModelScopeBody: "{model} در ModelScope موجود نیست، بنابراین بررسیهای امنیتی اجرا نشدند و از آنجا بارگذاری نمیشود. برای استفاده، منبع مدل را در تنظیمات به Hugging Face تغییر دهید.",+ checksFailedTitle: "بررسیهای امنیتی اجرا نشدند",+ checksFailedBody: "{model} از {source} خوانده نشد، بنابراین بررسیهای امنیتی کامل نشدند و بارگذاری نمیشود. اتصال و توکن خود را بررسی کنید و دوباره تلاش کنید. {note}",enableAndContinue: "فعال کردن و ادامه",},tour: {diff --git a/studio/frontend/src/i18n/locales/fr.ts b/studio/frontend/src/i18n/locales/fr.tsindex f0829bdc378..2a50a4f59a6 100644--- a/studio/frontend/src/i18n/locales/fr.ts+++ b/studio/frontend/src/i18n/locales/fr.ts@@ -5331,6 +5331,18 @@ export const fr = {flaggedIntro: "Notre analyseur automatique a signalé des problèmes, notamment :",nothingFlagged:"Notre analyseur automatique n'a signalé aucun fichier préoccupant, mais vérifiez quand même.",+ unscannedTitle: "Impossible d'analyser les fichiers du modèle",+ unscannedBody: "{model} contient des poids pickle, qui peuvent exécuter du code au chargement, et aucune analyse antimalware n'est disponible pour eux : il ne peut donc pas être chargé. {note}",+ unscannedIntro: "Fichiers qui n'ont pas pu être analysés :",+ switchSourceNote: "Choisissez Hugging Face comme source de modèles dans les paramètres pour le charger.",+ reconnectNote: "Connectez-vous à Hugging Face pour que son analyse puisse être lue, puis réessayez.",+ managedTitle: "Le code personnalisé est désactivé pour ce compte",+ managedNote: "Il est désactivé pour les comptes gérés. Demandez au propriétaire de l'installation de l'activer.",+ notFoundTitle: "Introuvable sur {source}",+ notFoundBody: "{model} est introuvable sur {source} : ses contrôles de sécurité n'ont donc pas pu s'exécuter. Vérifiez le nom, ou définissez un jeton avec accès si le dépôt est privé.",+ notOnModelScopeBody: "{model} n'est pas disponible sur ModelScope : ses contrôles de sécurité n'ont donc pas pu s'exécuter et il ne peut pas être chargé depuis cette source. Choisissez Hugging Face comme source de modèles dans les paramètres pour l'utiliser.",+ checksFailedTitle: "Impossible d'exécuter les contrôles de sécurité",+ checksFailedBody: "Impossible de lire {model} depuis {source} : ses contrôles de sécurité n'ont pas pu aboutir et il ne peut pas être chargé. Vérifiez votre connexion et votre jeton, puis réessayez. {note}",enableAndContinue: "Activer et continuer",},tour: {diff --git a/studio/frontend/src/i18n/locales/he.ts b/studio/frontend/src/i18n/locales/he.tsindex e241648b8c5..78909934034 100644--- a/studio/frontend/src/i18n/locales/he.ts+++ b/studio/frontend/src/i18n/locales/he.ts@@ -5343,6 +5343,18 @@ export const he = {flaggedIntro: "הסורק האוטומטי שלנו סימן בעיות, ביניהן:",nothingFlagged:"הסורק האוטומטי שלנו לא סימן קבצים מדאיגים, אבל כדאי לבדוק שוב.",+ unscannedTitle: "לא ניתן היה לסרוק את קובצי המודל",+ unscannedBody: "{model} כולל משקלי pickle, שיכולים להריץ קוד בזמן הטעינה, ואין עבורם סריקת תוכנות זדוניות זמינה, ולכן לא ניתן לטעון אותו. {note}",+ unscannedIntro: "קבצים שלא ניתן היה לסרוק:",+ switchSourceNote: "כדי לטעון אותו, החליפו את מקור המודלים ל-Hugging Face בהגדרות.",+ reconnectNote: "התחברו ל-Hugging Face כדי שאפשר יהיה לקרוא את הסריקה, ונסו שוב.",+ managedTitle: "קוד מותאם אישית כבוי בחשבון זה",+ managedNote: "הוא כבוי בחשבונות מנוהלים. בקשו מבעל ההתקנה להפעיל אותו.",+ notFoundTitle: "לא נמצא ב-{source}",+ notFoundBody: "{model} לא נמצא ב-{source}, ולכן לא ניתן היה להריץ את בדיקות האבטחה. בדקו את השם, או הגדירו אסימון עם גישה אם המאגר פרטי.",+ notOnModelScopeBody: "{model} אינו זמין ב-ModelScope, ולכן לא ניתן היה להריץ את בדיקות האבטחה ולא ניתן לטעון אותו משם. כדי להשתמש בו, החליפו את מקור המודלים ל-Hugging Face בהגדרות.",+ checksFailedTitle: "לא ניתן היה להריץ את בדיקות האבטחה",+ checksFailedBody: "לא ניתן היה לקרוא את {model} מ-{source}, ולכן לא ניתן היה להשלים את בדיקות האבטחה ולא ניתן לטעון אותו. בדקו את החיבור ואת האסימון ונסו שוב. {note}",enableAndContinue: "הפעל והמשך",},tour: {diff --git a/studio/frontend/src/i18n/locales/hi.ts b/studio/frontend/src/i18n/locales/hi.tsindex 36fafd3728b..6369c2f64fc 100644--- a/studio/frontend/src/i18n/locales/hi.ts+++ b/studio/frontend/src/i18n/locales/hi.ts@@ -5257,6 +5257,18 @@ export const hi = {flaggedIntro: "हमारे स्वचालित स्कैनर ने ये समस्याएँ चिह्नित कीं, जिनमें शामिल हैं:",nothingFlagged:"हमारे स्वचालित स्कैनर ने कोई चिंताजनक फ़ाइल चिह्नित नहीं की, फिर भी कृपया दोबारा जाँच लें।",+ unscannedTitle: "मॉडल फ़ाइलें स्कैन नहीं की जा सकीं",+ unscannedBody: "{model} में pickle वेट हैं, जो लोड होते समय कोड चला सकते हैं, और उनके लिए कोई मैलवेयर स्कैन उपलब्ध नहीं है, इसलिए इसे लोड नहीं किया जा सकता। {note}",+ unscannedIntro: "जो फ़ाइलें स्कैन नहीं की जा सकीं:",+ switchSourceNote: "इसे लोड करने के लिए सेटिंग्स में मॉडल स्रोत को Hugging Face पर बदलें।",+ reconnectNote: "Hugging Face से कनेक्ट करें ताकि उसका स्कैन पढ़ा जा सके, फिर दोबारा कोशिश करें।",+ managedTitle: "इस खाते के लिए कस्टम कोड बंद है",+ managedNote: "यह प्रबंधित खातों के लिए बंद है। इंस्टॉलेशन के स्वामी से इसे चालू करने को कहें।",+ notFoundTitle: "{source} पर नहीं मिला",+ notFoundBody: "{model} {source} पर नहीं मिला, इसलिए उसकी सुरक्षा जाँच नहीं चल सकी। नाम जाँचें, या रिपॉज़िटरी निजी हो तो एक्सेस वाला टोकन सेट करें।",+ notOnModelScopeBody: "{model} ModelScope पर उपलब्ध नहीं है, इसलिए उसकी सुरक्षा जाँच नहीं चल सकी और उसे वहाँ से लोड नहीं किया जा सकता। इसे उपयोग करने के लिए सेटिंग्स में मॉडल स्रोत को Hugging Face पर बदलें।",+ checksFailedTitle: "सुरक्षा जाँच नहीं चल सकी",+ checksFailedBody: "{model} को {source} से पढ़ा नहीं जा सका, इसलिए सुरक्षा जाँच पूरी नहीं हो सकी और इसे लोड नहीं किया जा सकता। अपना कनेक्शन और टोकन जाँचकर दोबारा कोशिश करें। {note}",enableAndContinue: "चालू करें और जारी रखें",},tour: {diff --git a/studio/frontend/src/i18n/locales/id.ts b/studio/frontend/src/i18n/locales/id.tsindex 5fc0814a49d..ac17a5567a2 100644--- a/studio/frontend/src/i18n/locales/id.ts+++ b/studio/frontend/src/i18n/locales/id.ts@@ -5650,6 +5650,18 @@ export const id = {flaggedIntro: "Pemindai otomatis kami menandai masalah, termasuk:",nothingFlagged:"Pemindai otomatis kami tidak menandai file yang mengkhawatirkan, tetapi harap periksa kembali.",+ unscannedTitle: "File model tidak dapat dipindai",+ unscannedBody: "{model} berisi bobot pickle, yang dapat menjalankan kode saat dimuat, dan tidak ada pemindaian malware yang tersedia untuknya, sehingga tidak dapat dimuat. {note}",+ unscannedIntro: "File yang tidak dapat dipindai:",+ switchSourceNote: "Ubah sumber model ke Hugging Face di Pengaturan untuk memuatnya.",+ reconnectNote: "Hubungkan ke Hugging Face agar hasil pemindaiannya dapat dibaca, lalu coba lagi.",+ managedTitle: "Kode kustom dinonaktifkan untuk akun ini",+ managedNote: "Fitur ini dinonaktifkan untuk akun terkelola. Minta pemilik instalasi untuk mengaktifkannya.",+ notFoundTitle: "Tidak ditemukan di {source}",+ notFoundBody: "{model} tidak ditemukan di {source}, sehingga pemeriksaan keamanannya tidak dapat dijalankan. Periksa namanya, atau atur token dengan akses jika repositorinya privat.",+ notOnModelScopeBody: "{model} tidak tersedia di ModelScope, sehingga pemeriksaan keamanannya tidak dapat dijalankan dan tidak dapat dimuat dari sana. Ubah sumber model ke Hugging Face di Pengaturan untuk menggunakannya.",+ checksFailedTitle: "Pemeriksaan keamanan tidak dapat dijalankan",+ checksFailedBody: "{model} tidak dapat dibaca dari {source}, sehingga pemeriksaan keamanannya tidak dapat diselesaikan dan tidak dapat dimuat. Periksa koneksi dan token Anda, lalu coba lagi. {note}",enableAndContinue: "Aktifkan dan lanjutkan",},tour: {diff --git a/studio/frontend/src/i18n/locales/it.ts b/studio/frontend/src/i18n/locales/it.tsindex 6383cc948ed..0b4fcc3a5e4 100644--- a/studio/frontend/src/i18n/locales/it.ts+++ b/studio/frontend/src/i18n/locales/it.ts@@ -5316,6 +5316,18 @@ export const it = {flaggedIntro: "Il nostro scanner automatico ha segnalato problemi tra cui:",nothingFlagged:"Il nostro scanner automatico non ha segnalato file preoccupanti, ma ti consigliamo di verificare comunque.",+ unscannedTitle: "Impossibile analizzare i file del modello",+ unscannedBody: "{model} include pesi pickle, che possono eseguire codice al caricamento, e per essi non è disponibile alcuna scansione antimalware, quindi non può essere caricato. {note}",+ unscannedIntro: "File che non è stato possibile analizzare:",+ switchSourceNote: "Imposta Hugging Face come origine dei modelli nelle Impostazioni per caricarlo.",+ reconnectNote: "Connettiti a Hugging Face per poter leggere la scansione, poi riprova.",+ managedTitle: "Il codice personalizzato è disattivato per questo account",+ managedNote: "È disattivato per gli account gestiti. Chiedi al proprietario dell'installazione di attivarlo.",+ notFoundTitle: "Non trovato su {source}",+ notFoundBody: "{model} non è stato trovato su {source}, quindi non è stato possibile eseguire i controlli di sicurezza. Controlla il nome o imposta un token con accesso se il repository è privato.",+ notOnModelScopeBody: "{model} non è disponibile su ModelScope, quindi non è stato possibile eseguire i controlli di sicurezza e non può essere caricato da lì. Imposta Hugging Face come origine dei modelli nelle Impostazioni per usarlo.",+ checksFailedTitle: "Impossibile eseguire i controlli di sicurezza",+ checksFailedBody: "Impossibile leggere {model} da {source}: i controlli di sicurezza non sono stati completati e non può essere caricato. Controlla la connessione e il token, poi riprova. {note}",enableAndContinue: "Abilita e continua",},tour: {diff --git a/studio/frontend/src/i18n/locales/ja.ts b/studio/frontend/src/i18n/locales/ja.tsindex 3e933ac385c..73bf4ee6644 100644--- a/studio/frontend/src/i18n/locales/ja.ts+++ b/studio/frontend/src/i18n/locales/ja.ts@@ -5196,6 +5196,18 @@ export const ja = {flaggedIntro: "自動スキャナーが次のような問題を検出しました:",nothingFlagged:"自動スキャナーは懸念のあるファイルを検出しませんでしたが、念のためご自身でも確認してください。",+ unscannedTitle: "モデルファイルをスキャンできませんでした",+ unscannedBody: "{model} には読み込み時にコードを実行できる pickle 重みが含まれており、マルウェアスキャンの結果もないため読み込めません。{note}",+ unscannedIntro: "スキャンできなかったファイル:",+ switchSourceNote: "設定でモデルソースを Hugging Face に切り替えると読み込めます。",+ reconnectNote: "Hugging Face に接続してスキャン結果を読み取れるようにしてから、もう一度お試しください。",+ managedTitle: "このアカウントではカスタムコードが無効です",+ managedNote: "管理対象アカウントでは無効になっています。インストールの所有者に有効化を依頼してください。",+ notFoundTitle: "{source} に見つかりません",+ notFoundBody: "{model} は {source} に見つからないため、セキュリティチェックを実行できませんでした。名前を確認するか、非公開リポジトリの場合はアクセス権のあるトークンを設定してください。",+ notOnModelScopeBody: "{model} は ModelScope で利用できないため、セキュリティチェックを実行できず、そこから読み込むこともできません。設定でモデルソースを Hugging Face に切り替えてください。",+ checksFailedTitle: "セキュリティチェックを実行できませんでした",+ checksFailedBody: "{source} から {model} を読み取れなかったため、セキュリティチェックを完了できず、読み込めません。接続とトークンを確認して、もう一度お試しください。{note}",enableAndContinue: "有効にして続行",},tour: {diff --git a/studio/frontend/src/i18n/locales/ko.ts b/studio/frontend/src/i18n/locales/ko.tsindex f8cc4472418..c0112c90d47 100644--- a/studio/frontend/src/i18n/locales/ko.ts+++ b/studio/frontend/src/i18n/locales/ko.ts@@ -5236,6 +5236,18 @@ export const ko = {flaggedIntro: "자동 검사기가 다음을 포함한 문제를 발견했습니다:",nothingFlagged:"자동 검사기가 우려되는 파일을 발견하지 않았지만, 한 번 더 확인하세요.",+ unscannedTitle: "모델 파일을 스캔할 수 없습니다",+ unscannedBody: "{model}에는 로드할 때 코드를 실행할 수 있는 pickle 가중치가 있고 사용할 수 있는 악성코드 스캔 결과가 없어 로드할 수 없습니다. {note}",+ unscannedIntro: "스캔할 수 없는 파일:",+ switchSourceNote: "설정에서 모델 소스를 Hugging Face로 전환하면 로드할 수 있습니다.",+ reconnectNote: "스캔 결과를 읽을 수 있도록 Hugging Face에 연결한 후 다시 시도하세요.",+ managedTitle: "이 계정에서는 사용자 지정 코드가 꺼져 있습니다",+ managedNote: "관리형 계정에서는 꺼져 있습니다. 설치 소유자에게 활성화를 요청하세요.",+ notFoundTitle: "{source}에서 찾을 수 없음",+ notFoundBody: "{source}에서 {model}을(를) 찾을 수 없어 보안 검사를 실행하지 못했습니다. 이름을 확인하거나, 비공개 저장소라면 액세스 권한이 있는 토큰을 설정하세요.",+ notOnModelScopeBody: "{model}은(는) ModelScope에서 사용할 수 없어 보안 검사를 실행하지 못했고 그곳에서 로드할 수도 없습니다. 설정에서 모델 소스를 Hugging Face로 전환하세요.",+ checksFailedTitle: "보안 검사를 실행할 수 없습니다",+ checksFailedBody: "{source}에서 {model}을(를) 읽지 못해 보안 검사를 완료할 수 없었으며 로드할 수 없습니다. 연결과 토큰을 확인한 후 다시 시도하세요. {note}",enableAndContinue: "사용 설정 후 계속",},tour: {diff --git a/studio/frontend/src/i18n/locales/nl.ts b/studio/frontend/src/i18n/locales/nl.tsindex e259bc1d7cd..9f9d3059f32 100644--- a/studio/frontend/src/i18n/locales/nl.ts+++ b/studio/frontend/src/i18n/locales/nl.ts@@ -5708,6 +5708,18 @@ export const nl = {"Onze automatische scanner heeft onder andere deze problemen gevonden:",nothingFlagged:"Onze automatische scanner heeft geen verdachte bestanden gevonden, maar controleer het zelf nog even.",+ unscannedTitle: "Modelbestanden konden niet worden gescand",+ unscannedBody: "{model} bevat pickle-gewichten, die bij het laden code kunnen uitvoeren, en er is geen malwarescan voor beschikbaar. Het kan daarom niet worden geladen. {note}",+ unscannedIntro: "Bestanden die niet konden worden gescand:",+ switchSourceNote: "Stel in Instellingen Hugging Face in als modelbron om het te laden.",+ reconnectNote: "Maak verbinding met Hugging Face zodat de scan kan worden gelezen en probeer het opnieuw.",+ managedTitle: "Aangepaste code staat uit voor dit account",+ managedNote: "Dit staat uit voor beheerde accounts. Vraag de eigenaar van de installatie om het in te schakelen.",+ notFoundTitle: "Niet gevonden op {source}",+ notFoundBody: "{model} is niet gevonden op {source}, dus de beveiligingscontroles konden niet worden uitgevoerd. Controleer de naam of stel een token met toegang in als de repository privé is.",+ notOnModelScopeBody: "{model} is niet beschikbaar op ModelScope, dus de beveiligingscontroles konden niet worden uitgevoerd en het kan daar niet worden geladen. Stel in Instellingen Hugging Face in als modelbron om het te gebruiken.",+ checksFailedTitle: "Beveiligingscontroles konden niet worden uitgevoerd",+ checksFailedBody: "{model} kon niet worden gelezen van {source}, dus de beveiligingscontroles konden niet worden voltooid en het kan niet worden geladen. Controleer je verbinding en token en probeer het opnieuw. {note}",enableAndContinue: "Inschakelen en doorgaan",},tour: {diff --git a/studio/frontend/src/i18n/locales/pl.ts b/studio/frontend/src/i18n/locales/pl.tsindex dd012f1a284..eb205b49d91 100644--- a/studio/frontend/src/i18n/locales/pl.ts+++ b/studio/frontend/src/i18n/locales/pl.ts@@ -5700,6 +5700,18 @@ export const pl = {flaggedIntro: "Nasz automatyczny skaner wykrył problemy, w tym:",nothingFlagged:"Nasz automatyczny skaner nie wykrył niepokojących plików, ale sprawdź to jeszcze raz.",+ unscannedTitle: "Nie można przeskanować plików modelu",+ unscannedBody: "{model} zawiera wagi pickle, które mogą uruchamiać kod podczas ładowania, a skanowanie pod kątem złośliwego oprogramowania jest dla nich niedostępne, więc nie można go załadować. {note}",+ unscannedIntro: "Pliki, których nie można przeskanować:",+ switchSourceNote: "Zmień źródło modeli na Hugging Face w Ustawieniach, aby go załadować.",+ reconnectNote: "Połącz się z Hugging Face, aby można było odczytać wynik skanowania, i spróbuj ponownie.",+ managedTitle: "Kod niestandardowy jest wyłączony dla tego konta",+ managedNote: "Jest wyłączony dla kont zarządzanych. Poproś właściciela instalacji o jego włączenie.",+ notFoundTitle: "Nie znaleziono w {source}",+ notFoundBody: "Nie znaleziono {model} w {source}, więc nie można było uruchomić kontroli bezpieczeństwa. Sprawdź nazwę lub ustaw token z dostępem, jeśli repozytorium jest prywatne.",+ notOnModelScopeBody: "{model} nie jest dostępny w ModelScope, więc nie można było uruchomić kontroli bezpieczeństwa ani załadować go z tego źródła. Zmień źródło modeli na Hugging Face w Ustawieniach, aby go użyć.",+ checksFailedTitle: "Nie można uruchomić kontroli bezpieczeństwa",+ checksFailedBody: "Nie można odczytać {model} z {source}, więc nie udało się ukończyć kontroli bezpieczeństwa i nie można go załadować. Sprawdź połączenie i token, a następnie spróbuj ponownie. {note}",enableAndContinue: "Włącz i kontynuuj",},tour: {diff --git a/studio/frontend/src/i18n/locales/pt-br.ts b/studio/frontend/src/i18n/locales/pt-br.tsindex 9502dffb7df..c4f138833e9 100644--- a/studio/frontend/src/i18n/locales/pt-br.ts+++ b/studio/frontend/src/i18n/locales/pt-br.ts@@ -5276,6 +5276,18 @@ export const ptBR = {flaggedIntro: "Nosso verificador automático encontrou problemas, incluindo:",nothingFlagged:"Nosso verificador automático não encontrou arquivos preocupantes, mas confira mesmo assim.",+ unscannedTitle: "Não foi possível verificar os arquivos do modelo",+ unscannedBody: "{model} inclui pesos pickle, que podem executar código ao carregar, e não há verificação de malware disponível para eles, então não pode ser carregado. {note}",+ unscannedIntro: "Arquivos que não puderam ser verificados:",+ switchSourceNote: "Mude a fonte de modelos para Hugging Face em Configurações para carregá-lo.",+ reconnectNote: "Conecte-se ao Hugging Face para que a verificação possa ser lida e tente novamente.",+ managedTitle: "O código personalizado está desativado nesta conta",+ managedNote: "Ele está desativado em contas gerenciadas. Peça ao proprietário da instalação para ativá-lo.",+ notFoundTitle: "Não encontrado em {source}",+ notFoundBody: "{model} não foi encontrado em {source}, então as verificações de segurança não puderam ser executadas. Confira o nome ou defina um token com acesso se o repositório for privado.",+ notOnModelScopeBody: "{model} não está disponível no ModelScope, então as verificações de segurança não puderam ser executadas e ele não pode ser carregado de lá. Mude a fonte de modelos para Hugging Face em Configurações para usá-lo.",+ checksFailedTitle: "Não foi possível executar as verificações de segurança",+ checksFailedBody: "Não foi possível ler {model} de {source}, então as verificações de segurança não puderam ser concluídas e ele não pode ser carregado. Verifique sua conexão e seu token e tente novamente. {note}",enableAndContinue: "Ativar e continuar",},tour: {diff --git a/studio/frontend/src/i18n/locales/ru.ts b/studio/frontend/src/i18n/locales/ru.tsindex 06d98fd18b2..0e3e5860abc 100644--- a/studio/frontend/src/i18n/locales/ru.ts+++ b/studio/frontend/src/i18n/locales/ru.ts@@ -5274,6 +5274,18 @@ export const ru = {flaggedIntro: "Наш автоматический сканер обнаружил проблемы, в том числе:",nothingFlagged:"Наш автоматический сканер не нашёл подозрительных файлов, но всё же перепроверьте.",+ unscannedTitle: "Не удалось проверить файлы модели",+ unscannedBody: "{model} содержит веса pickle, которые могут выполнять код при загрузке, и проверка на вредоносное ПО для них недоступна, поэтому модель нельзя загрузить. {note}",+ unscannedIntro: "Файлы, которые не удалось проверить:",+ switchSourceNote: "Чтобы загрузить её, выберите Hugging Face как источник моделей в настройках.",+ reconnectNote: "Подключитесь к Hugging Face, чтобы можно было прочитать результаты проверки, и повторите попытку.",+ managedTitle: "Пользовательский код отключён для этой учётной записи",+ managedNote: "Он отключён для управляемых учётных записей. Попросите владельца установки включить его.",+ notFoundTitle: "Не найдено на {source}",+ notFoundBody: "{model} не найдена на {source}, поэтому проверки безопасности не удалось выполнить. Проверьте название или укажите токен с доступом, если репозиторий закрытый.",+ notOnModelScopeBody: "{model} недоступна на ModelScope, поэтому проверки безопасности не удалось выполнить, и загрузить её оттуда нельзя. Чтобы использовать её, выберите Hugging Face как источник моделей в настройках.",+ checksFailedTitle: "Не удалось выполнить проверки безопасности",+ checksFailedBody: "Не удалось прочитать {model} из {source}, поэтому проверки безопасности не удалось завершить, и модель нельзя загрузить. Проверьте подключение и токен и повторите попытку. {note}",enableAndContinue: "Разрешить и продолжить",},tour: {diff --git a/studio/frontend/src/i18n/locales/sv.ts b/studio/frontend/src/i18n/locales/sv.tsindex 22dffe9cb09..ecb02a20527 100644--- a/studio/frontend/src/i18n/locales/sv.ts+++ b/studio/frontend/src/i18n/locales/sv.ts@@ -5490,6 +5490,18 @@ export const sv = {flaggedIntro: "Vår automatiska skanner flaggade problem, bland annat:",nothingFlagged:"Vår automatiska skanner flaggade inga oroande filer, men dubbelkolla ändå.",+ unscannedTitle: "Modellfilerna kunde inte genomsökas",+ unscannedBody: "{model} innehåller pickle-vikter, som kan köra kod när de läses in, och ingen genomsökning efter skadlig kod finns tillgänglig för dem, så modellen kan inte läsas in. {note}",+ unscannedIntro: "Filer som inte kunde genomsökas:",+ switchSourceNote: "Byt modellkälla till Hugging Face i Inställningar för att läsa in den.",+ reconnectNote: "Anslut till Hugging Face så att genomsökningen kan läsas och försök igen.",+ managedTitle: "Anpassad kod är avstängd för det här kontot",+ managedNote: "Den är avstängd för hanterade konton. Be installationens ägare att aktivera den.",+ notFoundTitle: "Hittades inte på {source}",+ notFoundBody: "{model} hittades inte på {source}, så säkerhetskontrollerna kunde inte köras. Kontrollera namnet eller ange en token med åtkomst om förrådet är privat.",+ notOnModelScopeBody: "{model} är inte tillgänglig på ModelScope, så säkerhetskontrollerna kunde inte köras och den kan inte läsas in därifrån. Byt modellkälla till Hugging Face i Inställningar för att använda den.",+ checksFailedTitle: "Säkerhetskontrollerna kunde inte köras",+ checksFailedBody: "{model} kunde inte läsas från {source}, så säkerhetskontrollerna kunde inte slutföras och den kan inte läsas in. Kontrollera anslutningen och din token och försök igen. {note}",enableAndContinue: "Aktivera och fortsätt",},tour: {diff --git a/studio/frontend/src/i18n/locales/th.ts b/studio/frontend/src/i18n/locales/th.tsindex 2ca45b120b6..a336c1433b3 100644--- a/studio/frontend/src/i18n/locales/th.ts+++ b/studio/frontend/src/i18n/locales/th.ts@@ -5376,6 +5376,18 @@ export const th = {trustNote: "ดำเนินการต่อเฉพาะเมื่อคุณเชื่อถือแหล่งที่มาของโมเดลเท่านั้น",flaggedIntro: "ตัวสแกนอัตโนมัติของเราพบปัญหา ได้แก่:",nothingFlagged: "ตัวสแกนอัตโนมัติของเราไม่พบไฟล์ที่น่ากังวล แต่โปรดตรวจสอบอีกครั้ง",+ unscannedTitle: "ไม่สามารถสแกนไฟล์โมเดลได้",+ unscannedBody: "{model} มีน้ำหนักแบบ pickle ซึ่งอาจรันโค้ดขณะโหลด และไม่มีผลสแกนมัลแวร์สำหรับไฟล์เหล่านี้ จึงไม่สามารถโหลดได้ {note}",+ unscannedIntro: "ไฟล์ที่สแกนไม่ได้:",+ switchSourceNote: "เปลี่ยนแหล่งโมเดลเป็น Hugging Face ในการตั้งค่าเพื่อโหลด",+ reconnectNote: "เชื่อมต่อกับ Hugging Face เพื่อให้อ่านผลสแกนได้ แล้วลองอีกครั้ง",+ managedTitle: "โค้ดที่กำหนดเองถูกปิดสำหรับบัญชีนี้",+ managedNote: "ถูกปิดสำหรับบัญชีที่มีการจัดการ โปรดขอให้เจ้าของการติดตั้งเปิดใช้งาน",+ notFoundTitle: "ไม่พบใน {source}",+ notFoundBody: "ไม่พบ {model} ใน {source} จึงไม่สามารถตรวจสอบความปลอดภัยได้ โปรดตรวจสอบชื่อ หรือตั้งค่าโทเค็นที่มีสิทธิ์เข้าถึงหากที่เก็บเป็นแบบส่วนตัว",+ notOnModelScopeBody: "{model} ไม่มีใน ModelScope จึงไม่สามารถตรวจสอบความปลอดภัยและโหลดจากแหล่งนั้นได้ เปลี่ยนแหล่งโมเดลเป็น Hugging Face ในการตั้งค่าเพื่อใช้งาน",+ checksFailedTitle: "ไม่สามารถตรวจสอบความปลอดภัยได้",+ checksFailedBody: "อ่าน {model} จาก {source} ไม่ได้ จึงตรวจสอบความปลอดภัยไม่เสร็จและไม่สามารถโหลดได้ โปรดตรวจสอบการเชื่อมต่อและโทเค็น แล้วลองอีกครั้ง {note}",enableAndContinue: "เปิดใช้และดำเนินการต่อ",},tour: {diff --git a/studio/frontend/src/i18n/locales/tr.ts b/studio/frontend/src/i18n/locales/tr.tsindex 88b07385ee4..517908f7320 100644--- a/studio/frontend/src/i18n/locales/tr.ts+++ b/studio/frontend/src/i18n/locales/tr.ts@@ -5645,6 +5645,18 @@ export const tr = {flaggedIntro: "Otomatik tarayıcımız şunlar dahil sorunlar işaretledi:",nothingFlagged:"Otomatik tarayıcımız endişe verici bir dosya işaretlemedi, ancak lütfen yine de kontrol edin.",+ unscannedTitle: "Model dosyaları taranamadı",+ unscannedBody: "{model}, yüklenirken kod çalıştırabilen pickle ağırlıkları içeriyor ve bunlar için kötü amaçlı yazılım taraması yok, bu yüzden yüklenemiyor. {note}",+ unscannedIntro: "Taranamayan dosyalar:",+ switchSourceNote: "Yüklemek için Ayarlar'dan model kaynağını Hugging Face olarak değiştirin.",+ reconnectNote: "Taramanın okunabilmesi için Hugging Face'e bağlanın ve yeniden deneyin.",+ managedTitle: "Bu hesapta özel kod kapalı",+ managedNote: "Yönetilen hesaplarda kapalıdır. Kurulum sahibinden etkinleştirmesini isteyin.",+ notFoundTitle: "{source} üzerinde bulunamadı",+ notFoundBody: "{model}, {source} üzerinde bulunamadı, bu yüzden güvenlik denetimleri çalıştırılamadı. Adı kontrol edin veya depo özelse erişimi olan bir belirteç ayarlayın.",+ notOnModelScopeBody: "{model}, ModelScope'ta yok, bu yüzden güvenlik denetimleri çalıştırılamadı ve oradan yüklenemiyor. Kullanmak için Ayarlar'dan model kaynağını Hugging Face olarak değiştirin.",+ checksFailedTitle: "Güvenlik denetimleri çalıştırılamadı",+ checksFailedBody: "{model}, {source} kaynağından okunamadı, bu yüzden güvenlik denetimleri tamamlanamadı ve yüklenemiyor. Bağlantınızı ve belirtecinizi kontrol edip yeniden deneyin. {note}",enableAndContinue: "Etkinleştir ve devam et",},tour: {diff --git a/studio/frontend/src/i18n/locales/uk.ts b/studio/frontend/src/i18n/locales/uk.tsindex 4966c63ea8e..87a47eb7c91 100644--- a/studio/frontend/src/i18n/locales/uk.ts+++ b/studio/frontend/src/i18n/locales/uk.ts@@ -5692,6 +5692,18 @@ export const uk = {flaggedIntro: "Наш автоматичний сканер виявив проблеми, зокрема:",nothingFlagged:"Наш автоматичний сканер не виявив підозрілих файлів, але все ж перевірте ще раз.",+ unscannedTitle: "Не вдалося перевірити файли моделі",+ unscannedBody: "{model} містить ваги pickle, які можуть виконувати код під час завантаження, і перевірка на шкідливе ПЗ для них недоступна, тому модель не можна завантажити. {note}",+ unscannedIntro: "Файли, які не вдалося перевірити:",+ switchSourceNote: "Щоб завантажити її, виберіть Hugging Face як джерело моделей у налаштуваннях.",+ reconnectNote: "Підключіться до Hugging Face, щоб можна було прочитати результати перевірки, і повторіть спробу.",+ managedTitle: "Користувацький код вимкнено для цього облікового запису",+ managedNote: "Його вимкнено для керованих облікових записів. Попросіть власника встановлення увімкнути його.",+ notFoundTitle: "Не знайдено на {source}",+ notFoundBody: "{model} не знайдено на {source}, тому перевірки безпеки не вдалося виконати. Перевірте назву або вкажіть токен із доступом, якщо репозиторій приватний.",+ notOnModelScopeBody: "{model} недоступна на ModelScope, тому перевірки безпеки не вдалося виконати, і завантажити її звідти не можна. Щоб використати її, виберіть Hugging Face як джерело моделей у налаштуваннях.",+ checksFailedTitle: "Не вдалося виконати перевірки безпеки",+ checksFailedBody: "Не вдалося прочитати {model} із {source}, тому перевірки безпеки не вдалося завершити, і модель не можна завантажити. Перевірте підключення й токен і повторіть спробу. {note}",enableAndContinue: "Дозволити й продовжити",},tour: {diff --git a/studio/frontend/src/i18n/locales/vi.ts b/studio/frontend/src/i18n/locales/vi.tsindex 2b70d07e2b7..999a2eca368 100644--- a/studio/frontend/src/i18n/locales/vi.ts+++ b/studio/frontend/src/i18n/locales/vi.ts@@ -5653,6 +5653,18 @@ export const vi = {"Trình quét tự động của chúng tôi đã phát hiện các vấn đề, bao gồm:",nothingFlagged:"Trình quét tự động của chúng tôi không phát hiện tệp đáng lo ngại nào, nhưng vui lòng kiểm tra lại.",+ unscannedTitle: "Không thể quét các tệp mô hình",+ unscannedBody: "{model} có trọng số pickle, loại tệp có thể chạy mã khi tải, và không có kết quả quét phần mềm độc hại cho chúng nên không thể tải. {note}",+ unscannedIntro: "Các tệp không thể quét:",+ switchSourceNote: "Hãy chuyển nguồn mô hình sang Hugging Face trong Cài đặt để tải.",+ reconnectNote: "Hãy kết nối với Hugging Face để đọc được kết quả quét, rồi thử lại.",+ managedTitle: "Mã tùy chỉnh đã tắt cho tài khoản này",+ managedNote: "Tính năng này bị tắt với tài khoản được quản lý. Hãy yêu cầu chủ sở hữu bản cài đặt bật nó.",+ notFoundTitle: "Không tìm thấy trên {source}",+ notFoundBody: "Không tìm thấy {model} trên {source} nên không thể chạy kiểm tra bảo mật. Hãy kiểm tra tên, hoặc đặt token có quyền truy cập nếu kho lưu trữ là riêng tư.",+ notOnModelScopeBody: "{model} không có trên ModelScope nên không thể chạy kiểm tra bảo mật và không thể tải từ đó. Hãy chuyển nguồn mô hình sang Hugging Face trong Cài đặt để sử dụng.",+ checksFailedTitle: "Không thể chạy kiểm tra bảo mật",+ checksFailedBody: "Không thể đọc {model} từ {source} nên không thể hoàn tất kiểm tra bảo mật và không thể tải. Hãy kiểm tra kết nối và token rồi thử lại. {note}",enableAndContinue: "Bật và tiếp tục",},tour: {diff --git a/studio/frontend/src/i18n/locales/zh-CN.ts b/studio/frontend/src/i18n/locales/zh-CN.tsindex afd4ea5e0f1..465eac37fb5 100644--- a/studio/frontend/src/i18n/locales/zh-CN.ts+++ b/studio/frontend/src/i18n/locales/zh-CN.ts@@ -5147,6 +5147,18 @@ export const zhCN = {flaggedIntro: "我们的自动扫描器标记了以下问题:",nothingFlagged:"我们的自动扫描器未标记任何可疑文件,但请再次确认。",+ unscannedTitle: "无法扫描模型文件",+ unscannedBody: "{model} 包含 pickle 权重,这类文件在加载时可能运行代码,而且没有可用的恶意软件扫描结果,因此无法加载。{note}",+ unscannedIntro: "无法扫描的文件:",+ switchSourceNote: "请在设置中将模型来源切换为 Hugging Face 后加载。",+ reconnectNote: "请连接到 Hugging Face 以读取其扫描结果,然后重试。",+ managedTitle: "此账户已关闭自定义代码",+ managedNote: "托管账户已关闭此功能。请联系安装所有者启用。",+ notFoundTitle: "在 {source} 上未找到",+ notFoundBody: "在 {source} 上未找到 {model},因此无法运行安全检查。请检查名称;如果仓库是私有的,请设置有访问权限的令牌。",+ notOnModelScopeBody: "{model} 在 ModelScope 上不可用,因此无法运行安全检查,也无法从该来源加载。请在设置中将模型来源切换为 Hugging Face 后使用。",+ checksFailedTitle: "无法运行安全检查",+ checksFailedBody: "无法从 {source} 读取 {model},因此安全检查未能完成,也无法加载。请检查网络连接和令牌后重试。{note}",enableAndContinue: "启用并继续",},tour: {diff --git a/studio/frontend/src/i18n/locales/zh-TW.ts b/studio/frontend/src/i18n/locales/zh-TW.tsindex d7bac0617a6..28795a26659 100644--- a/studio/frontend/src/i18n/locales/zh-TW.ts+++ b/studio/frontend/src/i18n/locales/zh-TW.ts@@ -5327,6 +5327,18 @@ export const zhTW = {trustNote: "只有在您信任此模型來源時才繼續。",flaggedIntro: "我們的自動掃描程式標記出下列問題:",nothingFlagged: "我們的自動掃描程式未標記任何可疑的檔案,但仍請再次確認。",+ unscannedTitle: "無法掃描模型檔案",+ unscannedBody: "{model} 包含 pickle 權重,這類檔案在載入時可能執行程式碼,而且沒有可用的惡意軟體掃描結果,因此無法載入。{note}",+ unscannedIntro: "無法掃描的檔案:",+ switchSourceNote: "請在設定中將模型來源切換為 Hugging Face 後載入。",+ reconnectNote: "請連線到 Hugging Face 以讀取其掃描結果,然後重試。",+ managedTitle: "此帳戶已關閉自訂程式碼",+ managedNote: "受管理帳戶已關閉此功能。請聯絡安裝擁有者啟用。",+ notFoundTitle: "在 {source} 上找不到",+ notFoundBody: "在 {source} 上找不到 {model},因此無法執行安全檢查。請檢查名稱;如果儲存庫是私人的,請設定有存取權限的權杖。",+ notOnModelScopeBody: "{model} 在 ModelScope 上無法使用,因此無法執行安全檢查,也無法從該來源載入。請在設定中將模型來源切換為 Hugging Face 後使用。",+ checksFailedTitle: "無法執行安全檢查",+ checksFailedBody: "無法從 {source} 讀取 {model},因此安全檢查未能完成,也無法載入。請檢查網路連線和權杖後重試。{note}",enableAndContinue: "啟用並繼續",},tour: {diff --git a/studio/frontend/tests/remote-code-block-copy.test.ts b/studio/frontend/tests/remote-code-block-copy.test.tsnew file mode 100644index 00000000000..de3c9916e5d--- /dev/null+++ b/studio/frontend/tests/remote-code-block-copy.test.ts@@ -0,0 +1,43 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++import assert from "node:assert/strict";+import test from "node:test";++import { blockCopy } from "../src/features/security/lib/block-copy.ts";+import { readSrc } from "./helpers/kit.ts";++test("only a scan finding is described as CRITICAL", () => {+ assert.equal(+ blockCopy("critical_findings", "ModelScope", false).note,+ "remoteCode.blockedNote",+ );+ const others = ["unsafe_files", "unscanned_weights", "managed_refused", "not_on_source", "unscannable", null] as const;+ for (const cause of others) {+ const copy = blockCopy(cause, "ModelScope", false);+ assert.notEqual(copy.note, "remoteCode.blockedNote");+ assert.notEqual(copy.title, "remoteCode.blockedTitle");+ }+});++test("each cause names its source's way forward", () => {+ const body = (source: string) => blockCopy("not_on_source", source, true).body;+ assert.equal(body("ModelScope"), "remoteCode.notOnModelScopeBody");+ assert.equal(body("Hugging Face"), "remoteCode.notFoundBody");+ const note = (cause: "unscanned_weights" | "unscannable", source: string) =>+ blockCopy(cause, source, false).note;+ assert.equal(note("unscanned_weights", "ModelScope"), "remoteCode.switchSourceNote");+ assert.equal(note("unscanned_weights", "Hugging Face"), "remoteCode.reconnectNote");+ assert.equal(note("unscannable", "ModelScope"), "remoteCode.switchSourceNote");+ assert.equal(note("unscannable", "Hugging Face"), undefined);+ assert.equal(+ blockCopy("unsafe_files", "Hugging Face", true).body,+ "remoteCode.unsafeBodyFromProvider",+ );+});++test("the dialog takes its blocked copy from the cause and the blocked repo", () => {+ const dialog = readSrc("features/security/components/remote-code-consent-dialog.tsx");+ assert.match(dialog, /blockCopy\(scan\?\.blockCause/);+ assert.match(dialog, /scan\?\.blockTarget \?\? scan\?\.modelName/);+});