File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
apps/models_provider/impl/local_model_provider/model Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ def __init__(self, **kwargs):
3030
3131 def embed_query (self , text : str ) -> List [float ]:
3232 bind = f'{ CONFIG .get ("LOCAL_MODEL_HOST" )} :{ CONFIG .get ("LOCAL_MODEL_PORT" )} '
33- res = requests .post (f'{ CONFIG .get ("LOCAL_MODEL_PROTOCOL" )} ://{ bind } /api/model/{ self .model_id } /embed_query' ,
33+ prefix = CONFIG .get_admin_path ()
34+ res = requests .post (f'{ CONFIG .get ("LOCAL_MODEL_PROTOCOL" )} ://{ bind } { prefix } /api/model/{ self .model_id } /embed_query' ,
3435 {'text' : text })
3536 result = res .json ()
3637 if result .get ('code' , 500 ) == 200 :
@@ -39,7 +40,8 @@ def embed_query(self, text: str) -> List[float]:
3940
4041 def embed_documents (self , texts : List [str ]) -> List [List [float ]]:
4142 bind = f'{ CONFIG .get ("LOCAL_MODEL_HOST" )} :{ CONFIG .get ("LOCAL_MODEL_PORT" )} '
42- res = requests .post (f'{ CONFIG .get ("LOCAL_MODEL_PROTOCOL" )} ://{ bind } /api/model/{ self .model_id } /embed_documents' ,
43+ prefix = CONFIG .get_admin_path ()
44+ res = requests .post (f'{ CONFIG .get ("LOCAL_MODEL_PROTOCOL" )} ://{ bind } /{ prefix } /api/model/{ self .model_id } /embed_documents' ,
4345 {'texts' : texts })
4446 result = res .json ()
4547 if result .get ('code' , 500 ) == 200 :
You can’t perform that action at this time.
0 commit comments