同样代码,windows执行没问题,linux上hang住,没有报错log
HuXiLiFeng opened this issue · 2 comments
Describe the bug
A clear and concise description of what the bug is.
同样代码,windows执行没问题,linux上hang住,没有报错log
Code to reproduce the issue
Provide a reproducible test case that is the bare minimum necessary to generate the problem.
import hanlp
HanLP = hanlp.load(hanlp.pretrained.mtl.CLOSE_TOK_POS_NER_SRL_DEP_SDP_CON_ELECTRA_BASE_ZH)
coarse_tok=HanLP('阿婆主来到北京立方庭参观自然语义科技公司。', tasks='tok/coarse')
fine_tok=HanLP('阿婆主来到北京立方庭参观自然语义科技公司。', tasks='tok/fine')
print(coarse_tok)
print(fine_tok)
Describe the current behavior
A clear and concise description of what happened.
windows本地:
相关数据已经下载到C:\Users\feng.li04\AppData\Roaming\hanlp,可以正常执行结果;
linux服务器上:
同样把上面的文件拷贝到~/.hanlp目录下,然后执行这个代码,没反应,hang住了。ctrl+c之后
感觉load函数不太好用,好像并不能直接读取一个解压好的目录,就像from_pretrained那样。
Expected behavior
A clear and concise description of what you expected to happen.
System information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
- Python version:3.10
- HanLP version:2.1.0b62
Other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
- I've completed this form and searched the web for solutions.
无法复现。猜测实际情况是你启动了2个以上进程,第一个进程正在解压你上传的模型,其他进程正在等待第一个进程。由于某种原因第一个进程还没有完成解压(你没有贴完整日志),比如你机器的CPU太慢,其他进程依旧处于等待状态,给你造成了hang住的假象,你没耐心就ctrl+c了。
load
可以load一个文件夹,无论你感觉怎么样,试试就知道了。