Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问用基于Chat-Haruhi-Fusion_B微调的ChatGLM2的模型,为什么禁用采样了后,每次推理的结果都不一样 #72

Open
renatz opened this issue Mar 22, 2024 · 0 comments

Comments

@renatz
Copy link
Contributor

renatz commented Mar 22, 2024

我把/ChatHaruhi/Haruhi-2-Dev/ChatHaruhi/ChatGLM2GPT.pyget_response()函数改成了:

response, history = self.model.chat(self.tokenizer, self.messages, history=[], do_sample=False),

基座模型Chatglm2-6b的modeling_chatglm.py的chat()改成了

def chat(self, tokenizer, query: str, history: List[Tuple[str, str]] = None, max_length: int = 8192, num_beams=1, do_sample=True, logits_processor=None, **kwargs):

gen_kwargs = {"max_length": max_length, "num_beams": num_beams, "do_sample": do_sample,  "logits_processor": logits_processor, **kwargs}

然而每次推理使用同样的user和同样的提问,回答还是不一样。
embedding和搜索中哪个功能涉及随机性的可能性大一些?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant