From 2f62c4a23a8895e88b818917253913352f1cd43a Mon Sep 17 00:00:00 2001 From: weiweiw Date: Wed, 26 Feb 2025 08:45:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=BC=80=E5=8F=91=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E7=9A=84=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- embedding.py | 4 ++-- int/train.sh | 2 +- intent_uie_api.py | 10 +++++----- post_api.py | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/embedding.py b/embedding.py index 83b407c..1e97c97 100644 --- a/embedding.py +++ b/embedding.py @@ -85,7 +85,7 @@ def init_env(): # 初始化模型 print("初始模型加载") # embedding = BCE_EMB(EMBEDDING_MODEL_PATH) - EMBEDDING_MODEL_PATH = "/home/workplace/models/m3e-base" + EMBEDDING_MODEL_PATH = "/mnt/d/weiweiwang/intention/models/m3e-base" embedding = M3E_EMB(EMBEDDING_MODEL_PATH) know_pass = KNOW_PASS(embedding) return know_pass @@ -98,7 +98,7 @@ if __name__ == "__main__": # 默认环境 know_pass = init_env() - uvicorn.run(app, host='0.0.0.0', port=6006) + uvicorn.run(app, host='0.0.0.0', port=6007) except Exception as e: print(f"API启动失败!\n报错:\n{e}") diff --git a/int/train.sh b/int/train.sh index bc0145c..6c5c16f 100644 --- a/int/train.sh +++ b/int/train.sh @@ -2,7 +2,7 @@ python train.py \ --do_train \ --do_eval \ --do_export \ - --model_name_or_path /home/workplace/models/ernie-3.0-tiny-base-v2-zh \ + --model_name_or_path /mnt/d/weiweiwang/intention/models/ernie-3.0-tiny-base-v2-zh \ --output_dir checkpoint \ --device gpu:0 \ --train_path ./data/train.txt \ diff --git a/intent_uie_api.py b/intent_uie_api.py index c0f1935..11b24b8 100644 --- a/intent_uie_api.py +++ b/intent_uie_api.py @@ -83,10 +83,10 @@ parser.add_argument("--schema_lang", choices=["ch", "en"], default="ch", help="S args = parser.parse_args() model_names = { - "intent_token": "/home/workplace/models/zero_int", - "intent_model": "/home/workplace/models/zero_int/model", - "uie_token":"/home/workplace/models/zero_uie", - "uie_model":"/home/workplace/models/zero_uie/model", + "intent_token": "/mnt/d/weiweiwang/intention/models/zero_int", + "intent_model": "/mnt/d/weiweiwang/intention/models/zero_int/model", + "uie_token":"/mnt/d/weiweiwang/intention/models/zero_uie", + "uie_model":"/mnt/d/weiweiwang/intention/models/zero_uie/model", } label_names = { "int" : "./int/data/label.txt", @@ -580,7 +580,7 @@ if __name__ == "__main__": int_model,int_tokenizer = get_model(model_names['intent_token'],model_names['intent_model']) uie_model,uie_tokenizer = get_model(model_names['uie_token'],model_names['uie_model']) host = "0.0.0.0" - port = 8072 + port = 18074 api_start(host,port) diff --git a/post_api.py b/post_api.py index a6f0999..e4c8b16 100644 --- a/post_api.py +++ b/post_api.py @@ -2,7 +2,7 @@ import requests class Similar(): def __init__(self): - self.url = 'http://127.0.0.1:6006' + self.url = 'http://127.0.0.1:6007' def post(self,url,json_p): headers = {