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

KeyError: 'llaga' #13

Open
Roachxzq opened this issue Aug 22, 2024 · 2 comments
Open

KeyError: 'llaga' #13

Roachxzq opened this issue Aug 22, 2024 · 2 comments

Comments

@Roachxzq
Copy link

Hello, it's a great work for me! I try to download model on huggingface.

Load model directly

from transformers import AutoTokenizer
address = "./src/model/llaga-simteg-HO-classification"
config = AutoTokenizer.from_pretrained(address, padding_side="left")

face the problem:

KeyError Traceback (most recent call last)
File c:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\auto\configuration_auto.py:993, in AutoConfig.from_pretrained(cls, pretrained_model_name_or_path, **kwargs)
992 try:
--> 993 config_class = CONFIG_MAPPING[config_dict["model_type"]]
994 except KeyError:

File c:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\auto\configuration_auto.py:695, in _LazyConfigMapping.getitem(self, key)
694 if key not in self._mapping:
--> 695 raise KeyError(key)
696 value = self._mapping[key]

KeyError: 'llaga'

During handling of the above exception, another exception occurred:

ValueError Traceback (most recent call last)
[d:](file://\src\LLaGA-master\test.py in line 9
[5](file:///src/model/llaga-simteg-HO-classification"
[6](file://src/model/GraphWiz_LLaMA2_7B_DPO"
7 # address = "meta-llama/Meta-Llama-Guard-2-8B"
8 # address = 'src/model/vicuna-7b-v1.5'
----> 9 config = AutoTokenizer.from_pretrained(address, padding_side="left")

File c:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\auto\tokenization_auto.py:854, in AutoTokenizer.from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs)
...
1001 else:
1002 # Fallback: use pattern matching on the string.
1003 # We go from longer names to shorter names to catch roberta before bert (for instance)

ValueError: The checkpoint you are trying to load has model type llaga but Transformers does not recognize this architecture. This could be because of an issue with the checkpoint, or because your version of Transformers is out of date.

Reinstall the latest transformers but it didn't work...

@ChenRunjin
Copy link
Collaborator

Because our model doesn't include the tokenizer file, it only includes the projector weight, you should load the tokenizer using base model weight. Our released projector is based on lmsys/vicuna-7b-v1.5-16k, you can use AutoTokenizer.from_pretrained(" lmsys/vicuna-7b-v1.5-16k")

@Roachxzq
Copy link
Author

Thanks for your help.

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

2 participants