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

how to resolve xlm-roberta convert fail #520

Open
520jefferson opened this issue Aug 9, 2023 · 0 comments
Open

how to resolve xlm-roberta convert fail #520

520jefferson opened this issue Aug 9, 2023 · 0 comments

Comments

@520jefferson
Copy link

520jefferson commented Aug 9, 2023

You are using a model of type xlm-roberta to instantiate a model of type bert. This is not supported for all configurations of models and can yield errors.
image
when i can revert , then test i met :====================START warmup====================
=========lightseq=========
lightseq generating...
type(inputs): <class 'torch.Tensor'> <class 'torch.Tensor'>
Traceback (most recent call last):
File "test/ls_bert.py", line 115, in
main()
File "test/ls_bert.py", line 95, in main
warmup(tokenizer, ls_model, hf_model, sentences)
File "test/ls_bert.py", line 51, in warmup
ls_generate(ls_model, inputs_id, attn_mask)
File "test/ls_bert.py", line 31, in ls_generate
ls_output, ls_time = ls_bert(model, inputs_id, attn_mask)
File "test/ls_bert.py", line 13, in ls_bert
ls_output = model.infer(inputs, attn_mask)
File "test/ls_bert.py", line 63, in infer
last_hidden_states = self.ls_bert.infer(inputs.numpy())
TypeError: infer(): incompatible function arguments. The following argument types are supported:
1. (self: lightseq.inference.Bert, input_seq: numpy.ndarray[int32], attn_mask: numpy.ndarray[int32]) -> numpy.ndarray[float32]

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