diff options
| author | tanaka takashi <isazaka@gmail.com> | 2026-06-28 17:39:32 +0900 |
|---|---|---|
| committer | tanaka takashi <isazaka@gmail.com> | 2026-06-28 17:39:32 +0900 |
| commit | b4f3c99a7d458d32517077ef77b0e5676020b9a2 (patch) | |
| tree | 5c0db0afffef74e1bc28cf049f94fdb746dd1187 /src/ollama_web/app.py | |
| parent | 9e430700cc58adbed5baf110961c08cbcb6a7135 (diff) | |
モデル名によってthinkingトグルがグレーアウトする不具合を修正 モデル名にスラッシュが含まれている場合にStarlette側でエスケープされる問題を回避
Diffstat (limited to 'src/ollama_web/app.py')
| -rw-r--r-- | src/ollama_web/app.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ollama_web/app.py b/src/ollama_web/app.py index 701cc3c..eeb3bae 100644 --- a/src/ollama_web/app.py +++ b/src/ollama_web/app.py @@ -38,6 +38,7 @@ class NoCacheStaticFiles(StaticFiles): response.headers["Cache-Control"] = "no-store, no-cache, must-revalidate, max-age=0" return response + _STATIC_DIR = Path(__file__).resolve().parent / "static" @@ -47,9 +48,7 @@ def create_app() -> Starlette: log_path = Path(settings.data_dir).resolve().parent / "server.log" log_path.parent.mkdir(parents=True, exist_ok=True) handler = logging.FileHandler(str(log_path), encoding="utf-8") - handler.setFormatter( - logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") - ) + handler.setFormatter(logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")) root = logging.getLogger() root.setLevel(logging.INFO) root.addHandler(handler) @@ -63,7 +62,7 @@ def create_app() -> Starlette: Route("/api/chat", chat_route.chat, methods=["POST"], name="chat"), Route("/api/models", models_route.get_models, methods=["GET"], name="models"), Route( - "/api/models/{model}/capabilities", + "/api/models/{model:path}/capabilities", models_route.get_model_capabilities, methods=["GET"], name="model_capabilities", |
