当前位置: 首页 > news >正文

github 以及 huggingface下载模型和数据

runningcheese/MirrorSite: 镜像网站合集 (github.com)

huggingface

下载模型和数据使用snapshot_download的方法

不会修改HuggingFace模型下载默认缓存路径?一篇教会你!_huggingface默认下载路径-CSDN博客

下载模型

使用snapshot_download

使用snapshot_download配置代理多线程下载模型 - 风之炼金术士华华 - 博客园

直接使用git下载

GIT_LFS_SKIP_SMUDGE=1 git clone git clone https://huggingface.co/facebook/
opt-125m
cd opt-125m
git lfs pull --include="*.bin"

下载数据

使用snapshot_download

import os
from huggingface_hub import snapshot_download
os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'
snapshot_download(repo_id = 'liuhaotian/LLaVA-CC3M-Pretrain-595K',  repo_type="dataset",  # 可选 [dataset,model] local_dir='/home/jsh/code/Train_llava/Data',# 下载到本地的路径resume_download=True, # 断点续传) 

使用 datasets的load_dataset

from datasets import load_dataset, Dataset 
dataset = load_dataset("gsm8k",'main',split='train')

如果是本地没有缓存那么会下载到路径

https://zhuanlan.zhihu.com/p/620652410

Windows系统中,HuggingFace模型的默认保存位置是C:\Users\username\.cache\huggingface\transformers。您可以更改shell环境变量来指定不同的缓存目录。例如,您可以更改默认的shell环境变量TRANSFORMERS_CACHE或者HF_HOME + transformers/

文件储存格式

会先把原文件格式下下来然后生成保存成.arrow文件

(hf_dataset_download) PS C:\code\hf_dataset_download> python .\dataset_modelscope.py
README.md: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7.94k/7.94k [00:00<?, ?B/s]
C:\Users\13783\.conda\envs\hf_dataset_download\lib\site-packages\huggingface_hub\file_download.py:139: UserWarning: `huggingface_hub` cache-system uses symlinks by default to efficiently store duplicated files but your machine does not support them in C:\Users\13783\.cache\huggingface\hub\datasets--gsm8k. Caching files will still work but in a degraded version that might require more space on your disk. This warning can be disabled by setting the `HF_HUB_DISABLE_SYMLINKS_WARNING` environment variable. For more details, see https://huggingface.co/docs/huggingface_hub/how-to-cache#limitations.
To support symlinks on Windows, you either need to activate Developer Mode or to run Python as an administrator. In order to activate developer mode, see this article: https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-developmentwarnings.warn(message)
train-00000-of-00001.parquet: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.31M/2.31M [00:00<00:00, 2.40MB/s]
test-00000-of-00001.parquet: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 419k/419k [00:00<00:00, 8.18MB/s]
Generating train split: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7473/7473 [00:00<00:00, 678809.61 examples/s] 
Generating test split: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1319/1319 [00:00<00:00, 439105.24 examples/s] 

修改下载位置 

通过datasets加载数据集

加载 - Hugging Face 中文

github

github下载国内镜像网站

▼ GitHub镜像网站
GitHub 访问在任意 github 链接后面加上 fast,也就是 githubfast.com,[示例]
在任意 github 链接前面加上 521,也就是 521github.com,[示例]
在任意 github 链接前面加上 kk,也就是 kkgithub.com,[示例]
GitHub 下载在 github 下载链接前面加上 https://mirror.ghproxy.com,[示例]
GitHub 文件夹项目地址,解决 GitHub 只能下载整个项目的问题。
GitHub CDNhttps://gcore.jsdelivr.net,180ms 延迟,海外服务器,有缓存。[示列]
https://cdn.jsdelivr.net,180ms 延迟,海外服务器,有缓存。[示列]
https://jsd.onmicrosoft.cn,15ms 延迟,国外服务器,无缓存。[示列]
https://jsd.cdn.zzko.cn,30ms 延迟,国外服务器,无缓存。[示列]
Stackoverflowfsou,在原网页前加上链接。[示例]
http://www.lryc.cn/news/482845.html

相关文章:

  • 使用 Vue 配合豆包MarsCode 实现“小恐龙酷跑“小游戏
  • 51c视觉~合集6
  • STM32(hal库)在串口中,USART和uart有什么区别?
  • 机器学习、深度学习面试知识点汇总
  • FPGA高速设计之Aurora64B/66B的应用与不足的修正
  • 如何通过PHP脚本自动推送WordPress文章至百度站长平台
  • ORA-01092 ORA-14695 ORA-38301
  • upload-labs通关练习---更新到15关
  • WPF 应用程序中使用 Prism 框架时,有多种方式可以注册服务和依赖项
  • 【ESP32】ESP-IDF开发 | 低功耗管理+RTC唤醒和按键唤醒例程
  • Windows 局域网IP扫描工具:IPScaner 轻量免安装
  • HTML的浮动与定位
  • 【网络安全 | 漏洞挖掘】我如何通过路径遍历实现账户接管
  • DB-GPT系列(四):DB-GPT六大基础应用场景part1
  • SpringCloud篇(服务拆分 / 远程调用 - 入门案例)
  • Rust 建造者模式
  • ANN DNN CNN SNN
  • go语言进阶之并发模式
  • Spring Cloud LoadBalancer:负载均衡的服务调用
  • 微信小程序之轮播图
  • 羲和数据集收集器1.3
  • UE--IOS打包失败 AutomationTool exiting with ExitCode=9 (9)
  • 第8章利用CSS制作导航菜单
  • UNIX网络编程-TCP套接字编程
  • 美团代付微信小程序 read.php 任意文件读取漏洞复现
  • centos7 node升级到node18
  • 使用Matlab建立随机森林
  • 【江苏-无锡】《无锡市市级政务信息化建设及运行维护项目支出预算标准(试行)》 -省市费用标准解读系列10
  • 2024-11-12 问AI: [AI面试题] 您将如何设计一个人工智能系统来预测电信公司的客户流失?
  • 【数字静态时序分析】复杂时钟树的时序约束SDC写法