2026年ClaudeCode与智谱GLM-4.6环境配置指南 (Windows/macOS/Ubuntu全平台部署教程)

ClaudeCode与智谱GLM-4.6环境配置指南 (Windows/macOS/Ubuntu全平台部署教程)sudo apt updatesudo apt install y python3 pip python3 venv git build essential pip3 install claudecode pip3 install transformers torch sentencepiec accelerate 如果希望从源码安装 GLM 4 6 git clone

大家好,我是讯享网,很高兴认识大家。这里提供最前沿的Ai技术和互联网信息。



sudo apt updatesudo apt install -y python3-pip python3-venv git build-essential
GPT plus 代充 只需 145pip3 install claudecode
pip3 install transformers torch sentencepiece accelerate

如果希望从源码安装GLM-4.6:

GPT plus 代充 只需 145git clone https://github.com/THUDM/GLM-4cd GLM-4pip3 install -e .

创建一个Python脚本test.py:

from transformers import AutoTokenizer, AutoModeltokenizer = AutoTokenizer.from_pretrained(“THUDM/glm-4-9b-chat”, trust_remote_code=True)model = AutoModel.from_pretrained(“THUDM/glm-4-9b-chat”, trust_remote_code=True).half().cuda()response, history = model.chat(tokenizer, “你好”, history=[])print(response)

运行:,若输出正常,说明智谱GLM-4.6安装成功。

小讯
上一篇 2026-03-21 18:25
下一篇 2026-03-21 18:23

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/233436.html