Skip to content

Instantly share code, notes, and snippets.

@relic-yuexi
relic-yuexi / HTMLGenerator.py
Last active July 11, 2024 05:42
Generate Random HTML Code With Python
import random
from faker import Faker
class HTMLGenerator:
"""
A class to generate random HTML content using Faker library.
"""
def __init__(self, language='en_US'):
"""
@relic-yuexi
relic-yuexi / README_hfd.md
Last active April 8, 2024 16:28 — forked from padeoe/README_hfd.md
CLI-Tool for download Huggingface models and datasets with aria2/wget+git

🤗Huggingface 模型下载器

考虑到官方的 huggingface-cli 缺乏多线程下载支持,以及 hf_transfer 错误处理不足的问题,这个命令行工具巧妙地利用 wgetaria2 下载 LFS 文件,并使用 git clone 下载其他文件。

特性

  • ⏯️ 断点续传: 你可以随时重新运行或使用 Ctrl+C 中断下载。
  • 🚀 多线程下载: 利用多线程加速下载过程。
  • 🚫 文件排除: 使用 --exclude--include 跳过或指定要下载的文件,节省时间以避免下载模型的重复格式文件(例如 .bin 和 .safetensors)。
  • 🔐 认证支持: 对于需要 Huggingface 登录的私有模型,使用 --hf_username--hf_token 进行身份验证。
  • 🪞 镜像站点支持: 通过设置 HF_ENDPOINT 环境变量使用镜像站点。