• 从 算力云 零开始部署ChatGLM2-6B 教程


    硬件最低需求,显存13G以上
    基本环境:
    AutoDL
    1.autodl-tmp 目录下

      git clone https://github.com/THUDM/ChatGLM2-6B.git
    
    • 1

    然后使用 pip 安装依赖:

    pip install -r requirements.txt
    
    • 1

    pip
    使用pip 阿里的
    再执行git clone之前,要先在命令行执行学术加速的代码,否则执行速度太慢。

    source /etc/network_turbo
    
    • 1
    git clone https://huggingface.co/THUDM/chatglm2-6b/
    
    • 1

    https://huggingface.co/THUDM/chatglm2-6b/
    在这里插入图片描述
    在这里插入图片描述

    wget https://huggingface.co/THUDM/chatglm2-6b/resolve/main/tokenizer.model
    wget https://huggingface.co/THUDM/chatglm2-6b/resolve/main/pytorch_model-00007-of-00007.bin
    wget https://huggingface.co/THUDM/chatglm2-6b/resolve/main/pytorch_model-00006-of-00007.bin
    wget https://huggingface.co/THUDM/chatglm2-6b/resolve/main/pytorch_model-00005-of-00007.bin
    wget https://huggingface.co/THUDM/chatglm2-6b/resolve/main/pytorch_model-00004-of-00007.bin
    wget https://huggingface.co/THUDM/chatglm2-6b/resolve/main/pytorch_model-00003-of-00007.bin
    wget https://huggingface.co/THUDM/chatglm2-6b/resolve/main/pytorch_model-00002-of-00007.bin
    wget https://huggingface.co/THUDM/chatglm2-6b/resolve/main/pytorch_model-00001-of-00007.bin
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    1. autodl-tmp/ChatGLM2-6B/ web_demo.py 路径修改
     demo.queue().launch(server_port=6006,share=True, inbrowser=True)
    tokenizer = AutoTokenizer.from_pretrained("/root/autodl-tmp/chatglm2-6b", trust_remote_code=True)
    model = AutoModel.from_pretrained("/root/autodl-tmp/chatglm2-6b", trust_remote_code=True).cuda()
    
    • 1
    • 2
    • 3

    在这里插入图片描述

  • 相关阅读:
    有什么自定义表单工具功能较好?
    UVa 762 - We Ship Cheap
    切片机制和MR工作机制
    2023.11.17 hadoop之HDFS进阶
    【kubernetes】探索k8s集群的存储卷、pvc和pv
    【spring】SpringBoot与SpringCloud的版本对应
    P1075 [NOIP2012 普及组] 质因数分解
    SpringCloud之Sentinel
    微信小程序--云开发
    DTOS帝拓思的3D引擎将取代游戏引擎巨兽,实现国产化替代
  • 原文地址:https://blog.csdn.net/qq_56352553/article/details/132752776