Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问hanlp可以加载本地模型吗 #31

Open
SetonLiang opened this issue Feb 15, 2025 · 0 comments
Open

请问hanlp可以加载本地模型吗 #31

SetonLiang opened this issue Feb 15, 2025 · 0 comments

Comments

@SetonLiang
Copy link

SetonLiang commented Feb 15, 2025

generator = KG2InstructGenerator(
label_db="/newdisk3/data/guihh/KG2Instruction/data/db/label_zh.db",
alias_db="/newdisk3/data/guihh/KG2Instruction/data/db/alias_zh.db",
alias_rev_db="/newdisk3/data/guihh/KG2Instruction/data/db/alias_rev_zh.db",
relation_db="/newdisk3/data/guihh/KG2Instruction/data/db/relation.db",
relation_map_path="/newdisk3/data/guihh/KG2Instruction/data/other/relation_map.json",
model="/newdisk3/data/guihh/KG2Instruction/model/close_tok_pos_ner_srl_dep_sdp_con_electra_base",
language="zh",
device=0,
add_relation_value=False
)

参照KG2Instruction 配好环境并下载了hanlp.pretrained.mtl.CLOSE_TOK_POS_NER_SRL_DEP_SDP_CON_ELECTRA_BASE_ZH的NER模型,通过hanlp.load加载了本地的预训练模型,但还是会重新下载在线模型:

Image

Downloading https://file.hankcs.com/hanlp/mtl/close_tok_pos_ner_srl_dep_sdp_con_electra_small_20210111_124159.zip to /home/.hanlp/mtl/close_tok_pos_ner_srl_dep_sdp_con_electra_small_20210111_124159.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant