diff --git a/apps/models_provider/impl/local_model_provider/model/embedding.py b/apps/models_provider/impl/local_model_provider/model/embedding.py index 3e296d5b1..94ea652af 100644 --- a/apps/models_provider/impl/local_model_provider/model/embedding.py +++ b/apps/models_provider/impl/local_model_provider/model/embedding.py @@ -30,7 +30,8 @@ class WebLocalEmbedding(MaxKBBaseModel, BaseModel, Embeddings): def embed_query(self, text: str) -> List[float]: bind = f'{CONFIG.get("LOCAL_MODEL_HOST")}:{CONFIG.get("LOCAL_MODEL_PORT")}' - res = requests.post(f'{CONFIG.get("LOCAL_MODEL_PROTOCOL")}://{bind}/api/model/{self.model_id}/embed_query', + prefix = CONFIG.get_admin_path() + res = requests.post(f'{CONFIG.get("LOCAL_MODEL_PROTOCOL")}://{bind}{prefix}/api/model/{self.model_id}/embed_query', {'text': text}) result = res.json() if result.get('code', 500) == 200: @@ -39,7 +40,8 @@ class WebLocalEmbedding(MaxKBBaseModel, BaseModel, Embeddings): def embed_documents(self, texts: List[str]) -> List[List[float]]: bind = f'{CONFIG.get("LOCAL_MODEL_HOST")}:{CONFIG.get("LOCAL_MODEL_PORT")}' - res = requests.post(f'{CONFIG.get("LOCAL_MODEL_PROTOCOL")}://{bind}/api/model/{self.model_id}/embed_documents', + prefix = CONFIG.get_admin_path() + res = requests.post(f'{CONFIG.get("LOCAL_MODEL_PROTOCOL")}://{bind}/{prefix}/api/model/{self.model_id}/embed_documents', {'texts': texts}) result = res.json() if result.get('code', 500) == 200: