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 blank page on Windows due to broken .js MIME type (#4674)
Roland Tannousa6c1f893fc87
diff --git a/studio/backend/main.py b/studio/backend/main.pyindex 65f5e7fe901..67908d8617c 100644--- a/studio/backend/main.py+++ b/studio/backend/main.py@@ -23,10 +23,23 @@ if _backend_dir not in sys.path:# See: https://github.com/python/cpython/issues/102396import _platform_compat # noqa: F401+import mimetypesimport shutilimport warningsfrom contextlib import asynccontextmanager+# Fix broken Windows registry MIME types. Some Windows installs map .js to+# "text/plain" in the registry (HKCR\.js\Content Type). Python's mimetypes+# module reads from the registry, and FastAPI/Starlette's StaticFiles uses+# mimetypes.guess_type() to set Content-Type headers. Browsers enforce strict+# MIME checking for ES module scripts (<script type="module">) and will refuse+# to execute .js files served as text/plain — resulting in a blank page.+# Calling add_type() *before* StaticFiles is instantiated ensures the correct+# types are used regardless of the OS registry.+if sys.platform == "win32":+ mimetypes.add_type("application/javascript", ".js")+ mimetypes.add_type("text/css", ".css")+# Suppress annoying dependency warnings in productionif os.getenv("ENVIRONMENT_TYPE", "production") == "production":warnings.filterwarnings("ignore")