shibing624 / pycorrector

pycorrector is a toolkit for text error correction. 文本纠错,实现了Kenlm,T5,MacBERT,ChatGLM3,Qwen2.5等模型应用在纠错场景,开箱即用。
https://www.mulanai.com/product/corrector/
Apache License 2.0
5.61k stars 1.1k forks source link

报错信息“ Binary file has size 21086208 but the headers say it should be at least 2953349384)” #389

Closed Gaia-Wu closed 8 months ago

Gaia-Wu commented 1 year ago

在此之前是可以成功运行的 截屏2023-05-09 09 39 14 我重新下载了文件还是不行 请问有解决办法吗

Gaia-Wu commented 1 year ago

貌似是因为我使用的本地模型路径没有生效? 截屏2023-05-09 10 54 28 运行的时候却出现: 截屏2023-05-09 10 54 58 提问: 模型路径一定需要放在‘~/.pycorrector/datasets/’下才可以嘛?

Yazooliu commented 1 year ago

源码里面应该可以追踪到路径配置信息

Yazooliu commented 1 year ago

貌似是因为我使用的本地模型路径没有生效? 截屏2023-05-09 10 54 28 运行的时候却出现: 截屏2023-05-09 10 54 58 提问: 模型路径一定需要放在‘~/.pycorrector/datasets/’下才可以嘛?

代码里看是的

-----用户目录,存储模型文件-----

USER_DATA_DIR = os.path.expanduser('~/.pycorrector/datasets/') os.makedirs(USER_DATA_DIR, exist_ok=True) language_model_path = os.path.join(USER_DATA_DIR, 'zh_giga.no_cna_cmn.prune01244.klm')

stale[bot] commented 10 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.(由于长期不活动,机器人自动关闭此问题,如果需要欢迎提问)

shibing624 commented 8 months ago

updated. 可以用

import os
os.environ["PYCORRECTOR_DATA_DIR"] = "/your_new_path/"

改变默认的模型路径 ~/.pycorrector/datasets//your_new_path/