chd错误->Unable to retrieve non-local non-loopback IP address. Seeing address: localhost/127.0.0.1

时间:2025-02-20 07:38:51
macbook安装chatglm2-6b

HZ1918: 在MAC上搭建了ChatGLM2-6B,可以通过streamlit run web_demo2.py以float方式跑chatglm2-6b-int4模型 以.half().to('mps')方式跑chatglm2-6b模型时报下面的异常 envs/chatglm3.11/lib/python3.11/site-packages/transformers/generation/logits_process.py", line 302, in __call__ indices_to_remove = scores < (scores, top_k)[0][..., -1, None] ^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: "topk_cpu" not implemented for 'Half'[code=python][code=python] [/code] def __call__(self, input_ids: , scores: ) -> : top_k = min(self.top_k, (-1)) # Safety check # Remove all tokens with a probability less than the last token of the top-k indices_to_remove = scores < (scores, top_k)[0][..., -1, None] scores = scores.masked_fill(indices_to_remove, self.filter_value) return scores