You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 │ ```""" │
The text was updated successfully, but these errors were encountered:
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 │ ```""" │
The text was updated successfully, but these errors were encountered: