学术资源加速
智川云为学术研究提供 GitHub 和 HuggingFace 等资源的访问加速服务。
公共加速服务
以下是可公开访问的加速服务:
| 服务 | 地址 | 说明 |
|---|---|---|
| GitHub 加速 | https://ghfast.top/ | GitHub 文件下载加速(当前可用,域名可能会变更,请及时确认;最新可用域名请以 https://ghproxy.link/ 列表为准) |
| HuggingFace 镜像 | https://hf-mirror.com/ | HuggingFace 模型下载加速 |
GitHub 加速使用
更详细的 GitHub 使用指南请参考 GitHub 使用指南。
加速 Clone
bash
# 原始地址
git clone https://github.com/username/repo.git
# 加速地址(示例,实际可用域名请以 https://ghfast.top/ 及其镜像为准)
git clone https://ghfast.top/https://github.com/username/repo.git加速 Release 下载
bash
# 原始地址
wget https://github.com/user/repo/releases/download/v1.0/file.zip
# 加速地址(示例)
wget https://ghfast.top/https://github.com/user/repo/releases/download/v1.0/file.zip加速 Raw 文件
bash
# 原始地址
wget https://raw.githubusercontent.com/user/repo/main/file.py
# 加速地址(示例)
wget https://ghfast.top/https://raw.githubusercontent.com/user/repo/main/file.pyHuggingFace 加速使用
设置镜像源
方法一:环境变量
bash
export HF_ENDPOINT=https://hf-mirror.com方法二:Python 代码中设置
python
import os
os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'
from transformers import AutoModel
model = AutoModel.from_pretrained("bert-base-chinese")使用 huggingface-cli 下载
bash
# 设置镜像
export HF_ENDPOINT=https://hf-mirror.com
# 下载模型
huggingface-cli download bert-base-chinese --local-dir ./bert-base-chinese直接从镜像站下载
访问 https://hf-mirror.com/ ,搜索模型后直接下载。
配置持久化
将加速配置写入 ~/.bashrc,每次登录自动生效:
bash
echo 'export HF_ENDPOINT=https://hf-mirror.com' >> ~/.bashrc
source ~/.bashrc注意事项
使用须知
- 加速服务仅供学术研究使用
- 服务可用性不做保证,如遇问题请尝试直连
- 部分私有仓库可能无法通过加速访问
自建网络优化服务
如果公共加速服务无法满足需求,可参考 clash-for-linux-install 自建代理服务。
说明
- 该工具可帮助优化国际学术资源的访问体验
- 需要自行准备代理配置文件
- 仅供学术研究使用,请遵守相关法律法规
其他加速技巧
pip 使用国内源
bash
pip install package -i https://pypi.tuna.tsinghua.edu.cn/simpleConda 使用国内源
bash
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --set show_channel_urls yesapt 使用国内源
大多数镜像已配置国内源,如需手动配置:
bash
sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
apt-get update