提交开发环境的配置
This commit is contained in:
parent
f89ef84f54
commit
2f62c4a23a
|
|
@ -85,7 +85,7 @@ def init_env():
|
||||||
# 初始化模型
|
# 初始化模型
|
||||||
print("初始模型加载")
|
print("初始模型加载")
|
||||||
# embedding = BCE_EMB(EMBEDDING_MODEL_PATH)
|
# 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)
|
embedding = M3E_EMB(EMBEDDING_MODEL_PATH)
|
||||||
know_pass = KNOW_PASS(embedding)
|
know_pass = KNOW_PASS(embedding)
|
||||||
return know_pass
|
return know_pass
|
||||||
|
|
@ -98,7 +98,7 @@ if __name__ == "__main__":
|
||||||
# 默认环境
|
# 默认环境
|
||||||
know_pass = init_env()
|
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:
|
except Exception as e:
|
||||||
print(f"API启动失败!\n报错:\n{e}")
|
print(f"API启动失败!\n报错:\n{e}")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ python train.py \
|
||||||
--do_train \
|
--do_train \
|
||||||
--do_eval \
|
--do_eval \
|
||||||
--do_export \
|
--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 \
|
--output_dir checkpoint \
|
||||||
--device gpu:0 \
|
--device gpu:0 \
|
||||||
--train_path ./data/train.txt \
|
--train_path ./data/train.txt \
|
||||||
|
|
|
||||||
|
|
@ -83,10 +83,10 @@ parser.add_argument("--schema_lang", choices=["ch", "en"], default="ch", help="S
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
model_names = {
|
model_names = {
|
||||||
"intent_token": "/home/workplace/models/zero_int",
|
"intent_token": "/mnt/d/weiweiwang/intention/models/zero_int",
|
||||||
"intent_model": "/home/workplace/models/zero_int/model",
|
"intent_model": "/mnt/d/weiweiwang/intention/models/zero_int/model",
|
||||||
"uie_token":"/home/workplace/models/zero_uie",
|
"uie_token":"/mnt/d/weiweiwang/intention/models/zero_uie",
|
||||||
"uie_model":"/home/workplace/models/zero_uie/model",
|
"uie_model":"/mnt/d/weiweiwang/intention/models/zero_uie/model",
|
||||||
}
|
}
|
||||||
label_names = {
|
label_names = {
|
||||||
"int" : "./int/data/label.txt",
|
"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'])
|
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'])
|
uie_model,uie_tokenizer = get_model(model_names['uie_token'],model_names['uie_model'])
|
||||||
host = "0.0.0.0"
|
host = "0.0.0.0"
|
||||||
port = 8072
|
port = 18074
|
||||||
api_start(host,port)
|
api_start(host,port)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import requests
|
||||||
|
|
||||||
class Similar():
|
class Similar():
|
||||||
def __init__(self):
|
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):
|
def post(self,url,json_p):
|
||||||
headers = {
|
headers = {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue