Giter VIP home page Giter VIP logo

chatglm-6b-engineering's Introduction

ChatGLM-6B-Engineering

Re-edit from ChatGLM-6B

https://www.bilibili.com/video/BV1gX4y1B7PV

介绍

ChatGLM-6B 是一个开源的、支持中英双语的对话语言模型,基于 General Language Model (GLM) 架构,具有 62 亿参数。结合模型量化技术,用户可以在消费级的显卡上进行本地部署

img

本项目基于 ChatGLM-6B 进行了后期调教,支持网上搜索及生成图片

生成图片则需要本地部署 Stable Diffusion 并加载 API:

python webui.py --xformers --nowebui

运行程序需要先运行 api.py,

再运行:

streamlit run streamlit_new.py

加载完成后在 http://localhost:8501/ 中查看

运行时错误

AssertionError: Torch not compiled with CUDA enabled

RuntimeError: CUDA error: no kernel image is available for execution on the device

请运行

nvidia-smi

nvcc -V

查看结果 如都正常无 error ,请运行

import torch
print(torch.cuda.is_available())

如返回为 True,

请将在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()

如返回为 False

请确认自己是否已安装gpu版本的torch

可参考网络教程

若设备无 nvidia 显卡,可参考 Readme 修改模型为 cpu 量化模型

引用

Forked from https://github.com/THUDM/ChatGLM-6B

chatglm-6b-engineering's People

Contributors

duzx16 avatar rainatam avatar sengxian avatar xiao9905 avatar lemonqu-git avatar cherrysaber avatar adambear avatar tuteng0915 avatar songxxzp avatar yanqiangmiffy avatar initialencounter avatar oedosoldier avatar ganymedenil avatar cjld avatar zwy4896 avatar nczkevin avatar littlestone0806 avatar dlutkaka avatar is avatar holk-h avatar coderabbit214 avatar binary-husky avatar zhangerling avatar yvrjsharma avatar hscspring avatar vinlic avatar jsl9208 avatar 1049451037 avatar luckyzy avatar liucongg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.