国外资源国内镜像访问(亲测)

关于huggingface模型下载:

手动下载(测试时间20240328):suno/bark · Hugging Face

 清华镜像(已失效):https://mirrors.tuna.tsinghua.edu.cn/hugging-face-models/hfl/

方式一:

使用huggingface镜像的方式为:HF_ENDPOINT=https://hf-mirror.com python yourmodel.py

代码下载:


import llama
#MODEL = '/home/guo/llama_test/llama_model'
MODEL = 'decapoda-research/llama-7b-hf'
# MODEL = 'decapoda-research/llama-13b-hf'
# MODEL = 'decapoda-research/llama-30b-hf'
# MODEL = 'decapoda-research/llama-65b-hf'
#建议使用tuna 与 bfsu
tokenizer = llama.LLaMATokenizer.from_pretrained(MODEL,mirror='tuna')
model = llama.LLaMAForCausalLM.from_pretrained(MODEL, mirror='tuna',low_cpu_mem_usage = True)
model.to('cpu')
batch = tokenizer("Yo mama", return_tensors = "pt")
print(tokenizer.decode(model.generate(batch["input_ids"], max_length=100)[0]))

方式二:手动下载模型文件(侵入式)

wget https://hf-mirror.com/hfd/hfd.sh

chmod a+x hfd.sh

export HF_ENDPOINT=https://hf-mirror.com

./hfd.sh openai-community/gpt2 --tool aria2c -x 4 对应下载的模型库路径为:openai-community/gpt2 · HF Mirror

关于github的镜像仓库下载,

参考:(4条消息) git clone 换源 / GitHub 国内镜像_git换源_面里多加汤的博客-CSDN博客


https://gitclone.com
# 服务器位于杭州(可用)
使用方式:原始git地址:https://github.com/junegunn/vim-plug
克隆地址: git clone https://gitclone.com/github.com/junegunn/vim-plug

关于pypi源:


linux进入到~/.pip/pip.conf
[global]
index-url=http://mirrors.aliyun.com/pypi/simple
trusted-host=mirrors.aliyun.com
window进入到~/pip/pip.conf
[global]
index-url=http://mirrors.aliyun.com/pypi/simple
trusted-host=mirrors.aliyun.com

关于conda源(国内源已经全部失效,建议直接使用国外默认源即可,速度还可以):


在~/.condarc修改conda 源:
channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/
show_channel_urls: true
ssl_verify: false
原文链接:https://blog.csdn.net/sslfk/article/details/127857073

  • 3
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

会发paper的学渣

您的鼓励和将是我前进的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值