Update README_zh.md
Browse files- README_zh.md +43 -6
README_zh.md
CHANGED
|
@@ -213,21 +213,58 @@ Lance 是一个轻量级、原生统一的多模态模型,在单一框架下
|
|
| 213 |
</table>
|
| 214 |
</div>
|
| 215 |
|
| 216 |
-
##
|
| 217 |
|
| 218 |
-
|
| 219 |
|
| 220 |
-
|
| 221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
|
| 223 |
-
### 安装步骤
|
| 224 |
```bash
|
| 225 |
bash ./setup_env.sh
|
|
|
|
| 226 |
```
|
| 227 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 228 |
### 下载模型权重
|
| 229 |
|
| 230 |
-
请从 [Lance-3B
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
|
| 232 |
## 📚 使用方法
|
| 233 |
|
|
|
|
| 213 |
</table>
|
| 214 |
</div>
|
| 215 |
|
| 216 |
+
### 安装步骤
|
| 217 |
|
| 218 |
+
首先,克隆代码仓库:
|
| 219 |
|
| 220 |
+
```bash
|
| 221 |
+
git clone https://github.com/bytedance-seed/Lance.git
|
| 222 |
+
cd Lance
|
| 223 |
+
```
|
| 224 |
+
|
| 225 |
+
#### 选项 1:自动安装
|
| 226 |
|
|
|
|
| 227 |
```bash
|
| 228 |
bash ./setup_env.sh
|
| 229 |
+
pip install flash-attn==2.8.3 --no-build-isolation
|
| 230 |
```
|
| 231 |
|
| 232 |
+
#### 选项 2:手动安装 (推荐)
|
| 233 |
+
|
| 234 |
+
```bash
|
| 235 |
+
conda create -n Lance python=3.11
|
| 236 |
+
conda activate Lance
|
| 237 |
+
pip3 install torch==2.5.1+cu124 torchvision==0.20.1+cu124 torchaudio==2.5.1+cu124 --index-url https://download.pytorch.org/whl/cu124
|
| 238 |
+
pip install -r requirements_full.txt
|
| 239 |
+
pip install flash-attn==2.8.3 --no-build-isolation
|
| 240 |
+
```
|
| 241 |
+
|
| 242 |
+
> **注意:** 如果从源码安装 `flash-attn` 失败,可以改为安装预编译 wheel:
|
| 243 |
+
>
|
| 244 |
+
> ```bash
|
| 245 |
+
> pip install --no-cache-dir --no-deps --force-reinstall \
|
| 246 |
+
> "https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.3/flash_attn-2.8.3%2Bcu12torch2.5cxx11abiFALSE-cp311-cp311-linux_x86_64.whl"
|
| 247 |
+
> ```
|
| 248 |
+
|
| 249 |
### 下载模型权重
|
| 250 |
|
| 251 |
+
请从 [Hugging Face 上的 Lance-3B](https://huggingface.co/bytedance-research/Lance) 下载所需的全部模型权重,并放置到 `downloads/` 目录下。
|
| 252 |
+
|
| 253 |
+
```bash
|
| 254 |
+
from huggingface_hub import snapshot_download
|
| 255 |
+
|
| 256 |
+
save_dir = "./downloads/"
|
| 257 |
+
repo_id = "bytedance-research/Lance"
|
| 258 |
+
cache_dir = save_dir + "/cache"
|
| 259 |
+
|
| 260 |
+
snapshot_download(cache_dir=cache_dir,
|
| 261 |
+
local_dir=save_dir,
|
| 262 |
+
repo_id=repo_id,
|
| 263 |
+
local_dir_use_symlinks=False,
|
| 264 |
+
resume_download=True,
|
| 265 |
+
allow_patterns=["*.json", "*.safetensors", "*.bin", "*.py", "*.md", "*.txt","*.pth",],
|
| 266 |
+
)
|
| 267 |
+
```
|
| 268 |
|
| 269 |
## 📚 使用方法
|
| 270 |
|