Closed yuanjingtai closed 8 months ago
写入model path就行,参考https://github.com/shibing624/pycorrector/blob/master/pycorrector/macbert/macbert_corrector.py#L25 指定为绝对路径。
thx
描述问题
请简明扼要地说明问题是什么。 我的网络环境有问题,请问怎么导入已经下载好的本地模型?
你好 请问你解决这个问题了嘛 我是那怕到了本地路径,还是从网上下载,老哥你是怎么解决的呀
Describe the Question
Please provide a clear and concise description of what the question is. 我的网络环境有问题,请问怎么导入已经下载好的本地模型?
你好,请问你的模型权重是在哪里下载的?
hf models
hf models
下载指定为绝对路径后,加载时会提示以下错误
Traceback (most recent call last):
File "/Users/zyb/Downloads/pycorrector-master/pycorrector/macbert/demo2.py", line 36, in
hf models
下载指定为绝对路径后,加载时会提示以下错误 Traceback (most recent call last): File "/Users/zyb/Downloads/pycorrector-master/pycorrector/macbert/demo2.py", line 36, in main() File "/Users/zyb/Downloads/pycorrector-master/pycorrector/macbert/demo2.py", line 14, in main m = MacBertCorrector() File "/Users/zyb/Downloads/pycorrector-master/pycorrector/macbert/macbert_corrector.py", line 28, in init self.model = BertForMaskedLM.from_pretrained(model_name_or_path) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/transformers/modeling_utils.py", line 3613, in from_pretrained with safe_open(resolved_archive_file, framework="pt") as f: safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooLarge
已解决
Describe the Question
Please provide a clear and concise description of what the question is. 我的网络环境有问题,请问怎么导入已经下载好的本地模型?