Skip to content

无法连接到huggingface模型库 #319

Open

Description

@shenjialiang

在定义好之后classes和Dataset之后,
使用
from openprompt.plms import load_plm
plm, tokenizer, model_config, WrapperClass = load_plm("bert", "bert-base-cased")

去加载预训练模型,报错显示:

OSError: We couldn't connect to 'https://huggingface.co/' to load this file, couldn't find it in the cached files and it looks like bert-base-cased is not the path to a directory containing a file named config.json.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.

网络并无问题

Activity

  1. jzySaber1996 commented on Nov 25, 2024

    @jzySaber1996

    挂梯子之后,import之后加上

    import os
    os.environ["http_proxy"] = "<proxy_addr:port>"
    os.environ["https_proxy"] = "<proxy_addr:port>"
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions