Skip to content

twnlp/ChineseErrorCorrector3-4B调用出错 #580

@njfanxun

Description

@njfanxun

Describe the Question

调用代码:
m3=GptCorrector(model_name_or_path=model_path)
corrected_dict = m3.correct_batch(error_sentences,prefix_prompt='你是一个文本纠错专家,纠正输入句子中的语法错误,并输出正确的句子,输入句子为:')
输出:
Generating outputs: 0%| | 0/1 [00:00<?, ?it/s]The attention mask is not set and cannot be inferred from input because pad token is same as eos token. As a consequence, you may observe unexpected behavior. Please pass your input's attention_mask to obtain reliable results.
然后程序就卡着不动,造成服务器卡死,只能重启。是因为模型没有生成结束,在一直重试吗?耗尽服务器资源?
https://huggingface.co/twnlp/ChineseErrorCorrector3-4B中,使用的方法
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=False # Switches between thinking and non-thinking modes. Default is True.
)
而gpt_model.py参数有差别,这个有问题吗?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions