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

UnboundLocalError: local variable 'pass_loras' referenced before assignment #17

Closed
ezra-ch opened this issue Dec 2, 2023 · 4 comments
Closed

Comments

@ezra-ch
Copy link

ezra-ch commented Dec 2, 2023

Loading model: /home/peko/models/capy34b
Traceback (most recent call last):
  File "/home/peko/tabbyAPI/main.py", line 289, in <module>
    for (module, modules) in load_status:
  File "/home/peko/tabbyAPI/model.py", line 187, in load_gen
    self.model.forward(input_ids, cache = self.cache, preprocess_only = True)
  File "/home/peko/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/peko/.local/lib/python3.10/site-packages/exllamav2/model.py", line 582, in forward
    r, ls = self._forward(input_ids = input_ids[:, chunk_begin : chunk_end],
  File "/home/peko/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/peko/.local/lib/python3.10/site-packages/exllamav2/model.py", line 655, in _forward
    x = module.forward(x, cache = cache, attn_mask = attn_mask, past_len = past_len, loras = loras)
  File "/home/peko/.local/lib/python3.10/site-packages/exllamav2/attn.py", line 478, in forward
    pass_loras,
UnboundLocalError: local variable 'pass_loras' referenced before assignment
peko@sdfsdfI:~/tabbyAPI$ ls  /home/peko/models/capy34b
README.md          generation_config.json             output-00003-of-00003.safetensors  tokenizer.model
added_tokens.json  output-00001-of-00003.safetensors  special_tokens_map.json            tokenizer_config.json
config.json        output-00002-of-00003.safetensors  tokenizer.json
@ezra-ch
Copy link
Author

ezra-ch commented Dec 2, 2023

low_mem: True in the config was making that error, made it false and it loads

@bdashore3
Copy link
Member

Hi there! Thanks for opening an issue. The low_mem option is experimental and has resulted in an error like that. If you'd like to save on vram, use 8-bit cache (cache_mode: FP8).

@ezra-ch
Copy link
Author

ezra-ch commented Dec 2, 2023

Hey, thanks for the repo, its really great.

A non related question but, just wondering about the streaming function. Im unsure how to receive text streams on silly tavern from the API. Are there any flags I must use?

@bdashore3
Copy link
Member

I'd recommend asking questions like these on the Discord Server (make sure to get the Tabby role when joining). Issues is moreso for bug reports and feature requests.

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