Failed to connect to huggingface.co port 443 after 75018 ms: Operation timed out

完美解决:Failed to connect to huggingface.co port 443 after 75018 ms: Operation timed out

方案一:

选择python依赖包,用代码程序解决
推荐:pycrawlers这个python包,使用这个包可以轻松实现批量下载,以及进度显示

from pycrawlers import huggingface
# 实例化类
hg = huggingface()

# 1.批量下载
urls = ['https://huggingface.co/ziqingyang/chinese-llama-2-13b/tree/main',
        'https://huggingface.co/ziqingyang/chinese-llama-2-7b/tree/main']
           
# 默认保存位置在当前脚本所在文件夹 ./
hg.get_batch_data(urls)

# 2.单个下载
url = 'https://huggingface.co/ziqingyang/chinese-llama-2-13b/tree/main'

# 默认保存位置在当前脚本所在文件夹 ./
hg.get_data(url)


# 自定义下载位置
# 多个不同位置
paths = ['/home/model-gpt/chinese-llama-2-13b','/home/model-gpt/chinese-llama-2-7b']
hg.get_batch_data(urls, paths)

# 单一位置
path = '/home/model-gpt'
hg.get_data(url, path)

原文链接:https://blog.csdn.net/T752462536/article/details/133382427

你可能感兴趣的:(大模型,人工智能,python)