Skip to content
Proyectos

soulteary/docker-llama2-chat

Ver en GitHub

Acerca de

¡Ejecuta LLaMA2 (oficial / versión en chino / INT4 / llama2.cpp) junto con otros! ¡SOLO 3 PASOS! (sin GPU / 5 GB de VRAM / 8~14 GB de VRAM)

IA y aprendizaje automático

Cómo se miden estas cifras

Crecimiento de estrellas medido

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Recopilando historial

Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.

README.md

Original

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 就可以开始玩了。

相关项目

Explorar proyectos relacionados

Cargando…