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

[report bug] Encountered when inferencing with Mistral models #124

Open
shrango opened this issue Oct 10, 2024 · 0 comments
Open

[report bug] Encountered when inferencing with Mistral models #124

shrango opened this issue Oct 10, 2024 · 0 comments

Comments

@shrango
Copy link

shrango commented Oct 10, 2024

I met the following error when inferencing with base_model Mistral-7b-Instruct-v0.2

File "~/Medusa/medusa/model/modeling_mistral_kv.py", line 74, in _make_sliding_window_causal_mask 
                    
mask = torch.triu(mask, diagonal=-sliding_window)
                                 ^^^^^^^^^^^^^^^
TypeError: bad operand type for unary -: 'NoneType'

I think I have found the reason: the sliding_window value is null for both Mistral-7b-Instruct-v0.2 and Mistral-7b-Instruct-v0.3, which triggers the bug above.

To fix it, I suggest the author add a line to file "medusa/model/modeling_mistral_kv.py", line 74, as follows:
switch

mask = torch.triu(mask, diagonal=-sliding_window)

into

if sliding_window is not None:
    mask = torch.triu(mask, diagonal=-sliding_window)
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