From e37aca6f63598e2e8aadd7a69f24a2bea49f9a9b Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Tue, 20 Aug 2024 12:48:32 +0200 Subject: [PATCH] fixed warning --- lollms/server/endpoints/lollms_diffusers.py | 4 +++- lollms/server/endpoints/lollms_generator.py | 5 ++++- lollms/server/endpoints/lollms_sd.py | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lollms/server/endpoints/lollms_diffusers.py b/lollms/server/endpoints/lollms_diffusers.py index 18a8277..df0ff97 100644 --- a/lollms/server/endpoints/lollms_diffusers.py +++ b/lollms/server/endpoints/lollms_diffusers.py @@ -8,7 +8,7 @@ description: """ from fastapi import APIRouter, Request from lollms.server.elf_server import LOLLMSElfServer -from pydantic import BaseModel +from pydantic import BaseModel, ConfigDict from starlette.responses import StreamingResponse from lollms.types import MSG_OPERATION_TYPE from lollms.main_config import BaseConfig @@ -27,6 +27,8 @@ lollmsElfServer:LOLLMSElfServer = LOLLMSElfServer.get_instance() class Identification(BaseModel): client_id: str class ModelPost(BaseModel): + model_config = ConfigDict(protected_namespaces=()) + client_id: str model_url: str # ----------------------- voice ------------------------------ diff --git a/lollms/server/endpoints/lollms_generator.py b/lollms/server/endpoints/lollms_generator.py index a8c5734..c9eaadf 100644 --- a/lollms/server/endpoints/lollms_generator.py +++ b/lollms/server/endpoints/lollms_generator.py @@ -11,7 +11,7 @@ description: from fastapi import APIRouter, HTTPException from fastapi.responses import PlainTextResponse from lollms.server.elf_server import LOLLMSElfServer -from pydantic import BaseModel +from pydantic import BaseModel, ConfigDict from starlette.responses import StreamingResponse from lollms.types import MSG_OPERATION_TYPE from lollms.utilities import detect_antiprompt, remove_text_from_string, trace_exception @@ -80,6 +80,8 @@ async def lollms_detokenize(request: LollmsDeTokenizeRequest): return {"status":False,"error":str(ex)} class LollmsGenerateRequest(BaseModel): + model_config = ConfigDict(protected_namespaces=()) + prompt: str model_name: Optional[str] = None personality: Optional[int] = -1 @@ -223,6 +225,7 @@ async def lollms_generate(request: LollmsGenerateRequest): class LollmsGenerateRequest(BaseModel): + model_config = ConfigDict(protected_namespaces=()) prompt: str images: List[str] model_name: Optional[str] = None diff --git a/lollms/server/endpoints/lollms_sd.py b/lollms/server/endpoints/lollms_sd.py index 2e49dac..bd18cfa 100644 --- a/lollms/server/endpoints/lollms_sd.py +++ b/lollms/server/endpoints/lollms_sd.py @@ -9,7 +9,7 @@ description: """ from fastapi import APIRouter, Request from lollms_webui import LOLLMSWebUI -from pydantic import BaseModel +from pydantic import BaseModel, ConfigDict from starlette.responses import StreamingResponse from lollms.types import MSG_OPERATION_TYPE from lollms.main_config import BaseConfig @@ -28,6 +28,8 @@ lollmsElfServer:LOLLMSWebUI = LOLLMSWebUI.get_instance() class Identification(BaseModel): client_id: str class ModelPost(BaseModel): + model_config = ConfigDict(protected_namespaces=()) + client_id: str model_url: str # ----------------------- voice ------------------------------