Giter Site home page Giter Site logo

gxy837 / docker-llama2-chat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from soulteary/docker-llama2-chat

0.0 0.0 0.0 8.75 MB

Play LLaMA2 (official / 中文版 / INT4 / llama2.cpp) Together! ONLY 3 STEPS! ( non GPU / 5GB vRAM / 8~14GB vRAM)

Home Page: https://www.zhihu.com/people/soulteary/posts

License: Apache License 2.0

Shell 3.09% Python 96.73% Roff 0.18%

docker-llama2-chat's Introduction

Docker LLaMA2 Chat / 羊驼二代

中文文档 | ENGLISH

三步上手 LLaMA2,一起玩!相关博客教程已更新,同样欢迎“一键三连” 🌟🌟🌟。

使用 Docker 快速上手,本地部署 7B 或 13B 官方模型,或者 7B 中文模型。

博客教程

类型 显存需求 特点 教程地址 教程时间
官方版(英文) 8~14GB 原汁原味 使用 Docker 快速上手官方版 LLaMA2 开源大模型 2023.07.21
LinkSoul 中文版(双语) 8~14GB 支持中文 使用 Docker 快速上手中文版 LLaMA2 开源大模型 2023.07.21
Transformers 量化(中文/官方) 5GB 加速推理、节约显存 使用 Transformers 量化 Meta AI LLaMA2 中文版大模型 2023.07.22
GGML (Llama.cpp) 量化 (中文/官方) 可以不需要显存 CPU 推理 构建能够使用 CPU 运行的 MetaAI LLaMA2 中文大模型 2023.07.23

你可以参考项目代码,举一反三,把模型跑起来,接入到你想玩的地方,包括并不局限于支持 LLaMA 1代的各种开源软件中。

预览图

使用方法

  1. 一条命令,从项目中构建官方版(7B或13B)模型镜像,或中文版镜像(7B或INT4量化版):
# 7B
bash scripts/make-7b.sh

# 或 13B
bash scripts/make-13b.sh

# 或 7B Chinese
bash scripts/make-7b-cn.sh

# 或 7B Chinese 4bit
bash scripts/make-7b-cn-4bit.sh
  1. 选择适合你的命令,从 HuggingFace 下载 LLaMA2 或中文模型:
# MetaAI LLaMA2 Models (10~14GB vRAM)
git clone https://huggingface.co/meta-llama/Llama-2-7b-chat-hf
git clone https://huggingface.co/meta-llama/Llama-2-13b-chat-hf

mkdir meta-llama
mv Llama-2-7b-chat-hf meta-llama/
mv Llama-2-13b-chat-hf meta-llama/

# 或 Chinese LLaMA2 (10~14GB vRAM)
git clone https://huggingface.co/LinkSoul/Chinese-Llama-2-7b

mkdir LinkSoul
mv Chinese-Llama-2-7b LinkSoul/

# 或 Chinese LLaMA2 4BIT (5GB vRAM)
git clone https://huggingface.co/soulteary/Chinese-Llama-2-7b-4bit

mkdir soulteary
mv Chinese-Llama-2-7b-4bit soulteary/

将下载好的模型,保持在一个正确的目录结构中。

tree -L 2 meta-llama
soulteary
└── ...
LinkSoul
└── ...
meta-llama
├── Llama-2-13b-chat-hf
│   ├── added_tokens.json
│   ├── config.json
│   ├── generation_config.json
│   ├── LICENSE.txt
│   ├── model-00001-of-00003.safetensors
│   ├── model-00002-of-00003.safetensors
│   ├── model-00003-of-00003.safetensors
│   ├── model.safetensors.index.json
│   ├── pytorch_model-00001-of-00003.bin
│   ├── pytorch_model-00002-of-00003.bin
│   ├── pytorch_model-00003-of-00003.bin
│   ├── pytorch_model.bin.index.json
│   ├── README.md
│   ├── Responsible-Use-Guide.pdf
│   ├── special_tokens_map.json
│   ├── tokenizer_config.json
│   ├── tokenizer.model
│   └── USE_POLICY.md
└── Llama-2-7b-chat-hf
    ├── added_tokens.json
    ├── config.json
    ├── generation_config.json
    ├── LICENSE.txt
    ├── model-00001-of-00002.safetensors
    ├── model-00002-of-00002.safetensors
    ├── model.safetensors.index.json
    ├── models--meta-llama--Llama-2-7b-chat-hf
    ├── pytorch_model-00001-of-00003.bin
    ├── pytorch_model-00002-of-00003.bin
    ├── pytorch_model-00003-of-00003.bin
    ├── pytorch_model.bin.index.json
    ├── README.md
    ├── special_tokens_map.json
    ├── tokenizer_config.json
    ├── tokenizer.json
    ├── tokenizer.model
    └── USE_POLICY.md
  1. 选择使用下面的适合你的命令,一键运行 LLaMA2 模型应用:
# 7B
bash scripts/run-7b.sh
# 或 13B
bash scripts/run-13b.sh
# 或 Chinese 7B
bash scripts/run-7b-cn.sh
# 或 Chinese 7B 4BIT
bash scripts/run-7b-cn-4bit.sh

模型运行之后,在浏览器中访问 http://localhost7860 或者 http://你的IP地址:7860 就可以开始玩了。

相关项目

docker-llama2-chat's People

Contributors

soulteary 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.