【ChatGLM-6B+StableDiffusion+網(wǎng)絡(luò)搜索】本地部署可繪圖

(已解決)遇到的問題:RuntimeError: CUDA Error: no kernel image is available for execution on the
原因:ChatGlm在使用量化(節(jié)省顯存技術(shù))時(shí)會(huì)在較老的架構(gòu)上出錯(cuò)
解決方法:
在api.py中第57行
model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).quantize(4).half().cuda()
更改為
model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).half().cuda()
也就是將.quantize(4)刪去
!?。?!
注意,對(duì)顯存要求高,占用約12g顯存
感謝UP主耐心解答
標(biāo)簽: