Spaces:
Sleeping
Sleeping
Update private_gpt/launcher.py
Browse files- private_gpt/launcher.py +2 -2
private_gpt/launcher.py
CHANGED
@@ -96,7 +96,7 @@ def create_app(root_injector: Injector) -> FastAPI:
|
|
96 |
|
97 |
@model_router.post("/switch_model")
|
98 |
async def switch_model(
|
99 |
-
new_model: str, current_user: dict = Depends(get_current_user)
|
100 |
):
|
101 |
# Check if the user has either "admin" or "user" role
|
102 |
if "user" not in current_user.get("role", []):
|
@@ -116,7 +116,7 @@ def create_app(root_injector: Injector) -> FastAPI:
|
|
116 |
# Switch the model using the LLMComponent
|
117 |
llm_component = root_injector.get(LLMComponent)
|
118 |
llm_component.switch_model(new_model, settings=settings)
|
119 |
-
|
120 |
|
121 |
# Return a success message
|
122 |
return {"message": f"Model switched to {new_model}"}
|
|
|
96 |
|
97 |
@model_router.post("/switch_model")
|
98 |
async def switch_model(
|
99 |
+
new_model: str, current_user: dict = Depends(get_current_user)
|
100 |
):
|
101 |
# Check if the user has either "admin" or "user" role
|
102 |
if "user" not in current_user.get("role", []):
|
|
|
116 |
# Switch the model using the LLMComponent
|
117 |
llm_component = root_injector.get(LLMComponent)
|
118 |
llm_component.switch_model(new_model, settings=settings)
|
119 |
+
|
120 |
|
121 |
# Return a success message
|
122 |
return {"message": f"Model switched to {new_model}"}
|