Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

colab doesn't work #3

Open
chuangzhidan opened this issue Apr 28, 2023 · 0 comments
Open

colab doesn't work #3

chuangzhidan opened this issue Apr 28, 2023 · 0 comments

Comments

@chuangzhidan
Copy link

model = get_model(model_name, peft_path)
when it exec to this line of code , i get the following error.
i bet it has sth to do with the model's path,so ,how do i fix it?

Explicitly passing a revision is encouraged when loading a configuration with custom code to ensure no malicious code has been contributed in a newer revision.
Loading model...THUDM/chatglm-6b lora:silk-road/luotuo-qa-lora-0.1
Explicitly passing a revision is encouraged when loading a model with custom code to ensure no malicious code has been contributed in a newer revision.
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in <cell line: 1>:1 │
│ │
│ /content/luotuo_qa/app/infer.py:19 in get_model │
│ │
│ 16 │ from transformers import AutoModel │
│ 17 │ import torch │
│ 18 │ torch.set_default_tensor_type(torch.cuda.HalfTensor) │
│ ❱ 19 │ model = AutoModel.from_pretrained(model_name, trust_remote_code=True, device_map='au │
│ 20 │ if peft_path is not None and peft_path != "": │
│ 21 │ │ model = PeftModel.from_pretrained(model, peft_path) │
│ 22 │ return model │
│ │
│ /usr/local/lib/python3.10/dist-packages/transformers/models/auto/auto_factory.py:462 in │
│ from_pretrained │
│ │
│ 459 │ │ │ │ ) │
│ 460 │ │ │ class_ref = config.auto_map[cls.name] │
│ 461 │ │ │ module_file, class_name = class_ref.split(".") │
│ ❱ 462 │ │ │ model_class = get_class_from_dynamic_module( │
│ 463 │ │ │ │ pretrained_model_name_or_path, module_file + ".py", class_name, **hub_kw │
│ 464 │ │ │ ) │
│ 465 │ │ │ model_class.register_for_auto_class(cls.name) │
│ │
│ /usr/local/lib/python3.10/dist-packages/transformers/dynamic_module_utils.py:388 in │
│ get_class_from_dynamic_module │
│ │
│ 385 │ cls = get_class_from_dynamic_module("sgugger/my-bert-model", "modeling.py", "MyBertM │
│ 386 │ ```""" │

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant