GithubHelp home page GithubHelp logo

git-cloner / aliendao Goto Github PK

View Code? Open in Web Editor NEW
538.0 4.0 55.0 83 KB

huggingface mirror download

Home Page: https://aliendao.cn

License: MIT License

Python 60.35% HTML 5.44% CSS 5.31% JavaScript 28.90%
download huggingface mirror

aliendao's Introduction

从hf或镜像下载模型

1、简介

  • 从hf下载模型(支持断点续传)
  • 从aliendao.cn下载模型(支持断点续传)
  • chat服务源码(调用国产大模型)

2、安装python虚拟环境

# windows到Anaconda官网下载安装
# Linux用以下方法安装
wget https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh
chmod +x Anaconda3-2022.10-Linux-x86_64.sh
./Anaconda3-2022.10-Linux-x86_64.sh
source ~/.bashrc

3、创建虚拟环境

git clone https://github.com/git-cloner/aliendao
cd aliendao
conda create -n aliendao python=3.10 -y
conda activate aliendao
pip install -r requirements.txt -i https://pypi.mirrors.ustc.edu.cn/simple --trusted-host=pypi.mirrors.ustc.edu.cn

4、下载

conda activate aliendao
# 下载模型,带上mirror优先从镜像下载
python model_download.py --repo_id 模型ID
# 举例
python model_download.py --repo_id baichuan-inc/Baichuan-7B
# 下载数据集
python model_download.py --repo_id 数据集ID --repo_type dataset
# 举例
python model_download.py --repo_id tatsu-lab/alpaca --repo_type dataset

aliendao's People

Contributors

little51 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

aliendao's Issues

公司有代理的情况下,如何下载呢?

python model_download.py --repo_id stabilityai/stable-diffusion-xl-base-1.0 --mirror

报错
requests.exceptions.SSLError: HTTPSConnectionPool(host='e.aliendao.cn', port=443): Max retries exceeded with url: /models/stabilityai/stable-diffusion-xl-base-1.0?json=true (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)')))

尝试model_download.pyli 151行增加proxy不行
尝试把model_download.pyli 150行替换https为http也不行

下载时经常出现500错误

命令:

python model_download.py --repo_id SakuraLLM/Sakura-1B8-Qwen2beta-v0.9.1  --token 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

之前用的huggingface-cli download --resume-download xx --local-dir xx下载经常出现416错误,只好换这个,但这个报错提示:

(aliendao) G:\[Notes]\aliendao>python model_download.py --repo_id SakuraLLM/Sakura-1B8-Qwen2beta-v0.9.1  --token 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
2024-04-06 21:00:17 SakuraLLM/Sakura-1B8-Qwen2beta-v0.9.1 mirror :500
2024-04-06 21:00:17 SakuraLLM/Sakura-1B8-Qwen2beta-v0.9.1 download :下载资源发生了错误,请使用正确的token

(aliendao) G:\[Notes]\aliendao>

怎么破?

TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

运行 python model_download.py --repo_id stabilityai/stable-video-diffusion-img2vid-xt 时发生以下错误,请教如何解决。谢谢!!

Traceback (most recent call last):
File "/home/ubuntu/aliendao/model_download.py", line 221, in
download_model_from_mirror(
File "/home/ubuntu/aliendao/model_download.py", line 199, in download_model_from_mirror
if _download_model_from_mirror(_repo_id, _repo_type, _token, _e):
File "/home/ubuntu/aliendao/model_download.py", line 193, in _download_model_from_mirror
if not _download_file_resumable(url, file_name, i, len(files)):
File "/home/ubuntu/aliendao/model_download.py", line 135, in _download_file_resumable
total_length = int(r.headers.get('content-length'))
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

下载某些模型,需要身份认证,应该怎么处理?

当下载tiiuae/falcon-180B-chat模型时,执行命令后提示需要登录认证,要如何解决?

$ python model_download.py --repo_id tiiuae/falcon-180B-chat --mirror

2023-09-19 18:00:43 tiiuae/falcon-180B-chat mirror :500
2023-09-19 18:00:45 tiiuae/falcon-180B-chat success :401 Client Error. (Request ID: Root=1-6509714d-1ee4c4267f2bc5df0d916723;83665afb-3d62-414b-99cf-75a2865f6ac2)

Cannot access gated repo for url https://huggingface.co/api/models/tiiuae/falcon-180B-chat/revision/main.
Repo model tiiuae/falcon-180B-chat is gated. You must be authenticated to access it.

下载的镜像文件为0kb

请问为什么我下载的镜像文件都是0KB(所有文件都是0KB)

python model_download.py --mirror --repo_id baichuan-inc/Baichuan2-13B-Chat

这是我下载的模型

运行命令时报错

使用命令 python model_download.py --repo_id Qwen/Qwen-VL-Chat --mirror 时,报错TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

Bug Fix Suggestion for _download_file_resumable in model_download.py

Hello,

我在使用过程中遇到了一个小问题,并想分享我找到的解决方案,希望能对其他使用者也有所帮助。

问题描述

在使用 _download_file_resumable 函数下载文件时,如果服务器的响应中没有 content-length 头部,脚本会抛出 TypeError。这是因为脚本试图将 None 转换为整数。

出现错误的代码

total_length = int(r.headers.get('content-length'))

建议的解决方案

我建议在尝试转换之前检查 content-length 是否存在。如果不存在,可以将 total_length 设置为 0 或 None。以下是修改后的代码段:

total_length = r.headers.get('content-length')

if total_length is not None:
    total_length = int(total_length)
else:
    # 如果没有content-length头,可以选择跳过进度条或使用其他方法估计文件大小
    total_length = 0  # 或者设置为None,根据您的需求调整

这个修改可以防止在缺少 content-length 头部时脚本崩溃,并允许下载继续进行。

希望这个建议对您有所帮助。再次感谢您的工作!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.