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

does not appear to have a file named config.json #482

Open 5zjk5 opened 7 months ago

5zjk5 commented 7 months ago
    def gpt_model(self, texts=None):
        if texts is None:
            texts = ['今天新情很好', '你找到你最喜欢的工作,我也很高心。']
        m = GptCorrector("../model/chatglm3-6b-csc-chinese-lora")
        res = m.correct_batch(texts)
        print('MacBert4CSC模型', texts, '=>', res)
        return res[0]['target']

使用 gpt 模型报错少了 config 文件,下载链接中也没有 config https://huggingface.co/shibing624/chatglm3-6b-csc-chinese-lora/tree/main

shibing624 commented 7 months ago

看下usage: https://huggingface.co/shibing624/chatglm3-6b-csc-chinese-lora#usage-huggingface-transformers

5zjk5 commented 7 months ago

看下usage: https://huggingface.co/shibing624/chatglm3-6b-csc-chinese-lora#usage-huggingface-transformers

感谢作者