赞
踩
下载方式一
```
# 查看服务器操作系统,根据操作系统选择git-lfs下载方式
uname -a
# 下载 git-lfs ubuntu版
sudo apt-get install git-lfs
# 下载 git-lfs centos版
sudo yum install git-lfs
# 初始化git-lfs
git lfs install
# 下载预训练权重
git clone https://huggingface.co/Tele-AI/Telechat-7B
```
下载方式二
```
from transformers import AutoModel, AutoTokenizer
import os, sys
os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'
# 以bert-base-uncased为例,你可以根据需要更换为其他模型
model_name = "Tele-AI/telechat-7B"
save_dir = model_name
# 下载并缓存模型和分词器(tokenizer)
model = AutoModel.from_pretrained(model_name, cache_dir=save_dir)
tokenizer = AutoTokenizer.from_pretrained(model_name, cache_dir=save_dir)
```
下载方式三
```
import os
os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'
from huggingface_hub import snapshot_download
snapshot_download(repo_id="Tele-AI/telechat-7B",
local_dir_use_symlinks = False,
local_dir = "./Tele-AI/telechat-7B")
```
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。