---
title: Meta-Llama-3-8B-Instruct-2layers
canonical_url: "https://www.modelscope.cn/models/wdndev/Meta-Llama-3-8B-Instruct-2layers"
md_url: "https://www.modelscope.cn/models/wdndev/Meta-Llama-3-8B-Instruct-2layers.md"
repository: wdndev/Meta-Llama-3-8B-Instruct-2layers
last_updated: 2024-05-27
license: "Apache License 2.0"
pipeline_tag: text-generation
tasks:
  - text-generation
library_name:
  - pytorch
frameworks:
  - Pytorch
downloads: 714
stars: 1
---

# Meta-Llama-3-8B-Instruct-2layers

> Meta-Llama-3-8B-Instruct-2layers - wdndev 在 ModelScope 开源的模型。Meta-Llama-3-8B-Instruct的前两层，用于学习 llama3 教程，详细见GitHub：https://github.com/wdndev/llama3-from-scratch-zh

wdndev/Meta-Llama-3-8B-Instruct-2layers 是 ModelScope 魔搭社区上的text-generation模型，采用 Apache License 2.0 许可。

- **Repository**: wdndev/Meta-Llama-3-8B-Instruct-2layers
- **License**: Apache License 2.0
- **Tasks**: text-generation
- **Downloads**: 714
- **Stars**: 1
- **Last updated**: 2024-05-27

Source: https://www.modelscope.cn/models/wdndev/Meta-Llama-3-8B-Instruct-2layers

---

## 1.简介 (Introduction)

本模型是Meta-Llama-3-8B-Instruct模型的前两层，由于Llama3-8B共有32层，使用CPU加载模型时，16G的内存无法加载模型，故从32层中摘取前两层保存为一个新的模型。

主要用于 [llama3-from-scratch-zh](https://github.com/wdndev/llama3-from-scratch-zh) 和 [llama3-from-scratch](https://github.com/naklecha/llama3-from-scratch) 的学习，方便笔记本用户快速加载模型，运行学习。


This model is the first two layers of the Meta-Llama 3-8B-Instruct model. As Llama3-8B has 32 layers, the model cannot be loaded with 16G of memory when CPU is used to load the model, so remove the first two layers from the 32 layers and store them as a new model.

It is mainly used for [llama3-from-scratch-zh](https://github.com/wdndev/llama3-from-scratch-zh) and [llama3-from-scratch](https://github.com/naklecha/llama3-from-scratch) learning, convenient laptop users fast load model, operation study.

## 2.模型下载 (Model Download)

SDK doenload
```bash
# install ModelScope
pip install modelscope
```
```python
#SDK download model
from modelscope import snapshot_download
model_dir = snapshot_download('wdndev/Meta-Llama-3-8B-Instruct-2layers')
```
Git download model
```
#Git模型下载
git clone https://www.modelscope.cn/wdndev/Meta-Llama-3-8B-Instruct-2layers.git
```

<p style="color: lightgrey;">如果您是本模型的贡献者，我们邀请您根据<a href="https://modelscope.cn/docs/ModelScope%E6%A8%A1%E5%9E%8B%E6%8E%A5%E5%85%A5%E6%B5%81%E7%A8%8B%E6%A6%82%E8%A7%88" style="color: lightgrey; text-decoration: underline;">模型贡献文档</a>，及时完善模型卡片内容。</p>
