fix: resolve basicsr/torchvision shim bug, lint warnings, and code formatting

The torchvision compatibility shim for basicsr 1.4.2 was missing the
parent-package binding and only proxied a single attribute, causing
upscale and enhance-faces to fail at import time. The fix adds a
__getattr__ proxy for all attributes, binds the shim to the parent
package, and installs it in the dispatcher at startup for defense-in-depth.

Also removes unused anyInstalling variable, redundant `as any` cast,
and applies Biome formatting fixes across the codebase.
This commit is contained in:
ashim-hq
2026-04-20 17:03:17 +08:00
parent 39e27635c8
commit e7eea34080
9 changed files with 216 additions and 53 deletions
@@ -91,8 +91,6 @@ export function AiFeaturesSection() {
prevInstallingKeys.current = currentKeys;
}, [installing, loadDiskUsage]);
const anyInstalling = Object.keys(installing).length > 0;
return (
<div className="space-y-5">
<div className="flex items-center justify-between">
@@ -105,9 +103,7 @@ export function AiFeaturesSection() {
<button
type="button"
onClick={installAll}
disabled={
installAllActive || bundles.every((b) => b.status === "installed")
}
disabled={installAllActive || bundles.every((b) => b.status === "installed")}
className="flex items-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground text-sm font-medium hover:bg-primary/90 transition-colors disabled:opacity-50"
>
<Download className="h-4 w-4" />