向AI转型的程序员都关注了这个号👇👇👇
关于huggingface模型下载:
手动下载(测试时间20240328):
suno/bark · Hugging Face
https://hf-mirror.com/suno/bark
清华镜像:https://mirrors.tuna.tsinghua.edu.cn/
方式一:
使用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的镜像仓库下载
目前,国内可用的镜像网站有:
# 服务器位于香港
https://github.com.cnpmjs.org
# 服务器位于杭州
https://gitclone.com
# 服务器位于香港
https://doc.fastgit.org
比如在 clone 某一代码的时候,要用到的命令为:
git clone https://github.com/XXXXX
选择一个上面的镜像网站地址,例如选择 https://doc.fastgit.org
(个人常用),将命令更改为:
git clone https://hub.fastgit.org/XXXXX
注意,以上网站请不要登录,在进行替换之前请先进入网站查看对应的替换命令,不同的网站替换方式不同。
或者使用全局参数,更改 git 参数
git config --global url."https://hub.fastgit.org/".insteadOf "https://github.com/"
使用全局参数更改以后,使用 vim ~/.gitconfig
命令即可查看当前的配置文件,看到以下配置。
[url "https://url you choose"] insteadOf = https://github.com/
关于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
阅读过本文的人还看了以下文章:
整理开源的中文大语言模型,以规模较小、可私有化部署、训练成本较低的模型为主
基于40万表格数据集TableBank,用MaskRCNN做表格检测
《深度学习入门:基于Python的理论与实现》高清中文PDF+源码
2019最新《PyTorch自然语言处理》英、中文版PDF+源码
《21个项目玩转深度学习:基于TensorFlow的实践详解》完整版PDF+附书代码
PyTorch深度学习快速实战入门《pytorch-handbook》
【下载】豆瓣评分8.1,《机器学习实战:基于Scikit-Learn和TensorFlow》
李沐大神开源《动手学深度学习》,加州伯克利深度学习(2019春)教材
【Keras】完整实现‘交通标志’分类、‘票据’分类两个项目,让你掌握深度学习图像分类
如何利用全新的决策树集成级联结构gcForest做特征工程并打分?
Machine Learning Yearning 中文翻译稿
斯坦福CS230官方指南:CNN、RNN及使用技巧速查(打印收藏)
中科院Kaggle全球文本匹配竞赛华人第1名团队-深度学习与特征工程
不断更新资源
深度学习、机器学习、数据分析、python
搜索公众号添加: datayx