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

Exllamav2 installed but alway got "AssertionError: Please install ExllamaV2 or LLama CPP Python as backend" #37

Open
vuminhquang opened this issue Oct 20, 2024 · 7 comments

Comments

@vuminhquang
Copy link

Hi,
I installed Exllamav2 via (successful)

git clone https://github.com/turboderp/exllamav2
cd exllamav2
pip install -r requirements.txt
pip install .

However, always get
File "/home/user/micromamba/envs/genv/lib/python3.12/site-packages/gallama/backend/model.py", line 39, in
assert ExLlamaV2 or Llama, "Please install ExllamaV2 or LLama CPP Python as backend"

Please help, thank you.

@remichu-ai
Copy link
Owner

Hi, I recalled have fixed this bug previously.

Can you try to update to the latest by running pip install -U gallama to see if the problem still persists

@vuminhquang
Copy link
Author

vuminhquang commented Oct 20, 2024

Hi,
I do the installation for gallama from code too with git clone and "pip install .".
The os using is fresh ubuntu noble (wsl).
So gallama should be latest, though.

@remichu-ai
Copy link
Owner

Can you try the following:
1/ Double check if you activate the environement correctly. Seem like you are using mamba, i am not sure how it goes for mamba but i am using conda and i need to activate the environement before using e.g. conda activate genv

2/ Try running the following script, you can also use jupyter notebook to run it line by line if it helps.

This is the part of the script that is showing error. As you can see from the script, it just import ExllamaV2 and then check if it is imported.
It wont go into this error "Please install ExllamaV2 or LLama CPP Python as backend" if the import for ExllamaV2 working

# import transformers
import torch
from typing import List, Dict
from gallama.logger.logger import logger
from gallama.data_classes.data_class import ModelParser

try:
    from exllamav2 import (
        ExLlamaV2,
        ExLlamaV2Tokenizer,
        ExLlamaV2Cache,
        ExLlamaV2Cache_Q4,
        ExLlamaV2Cache_Q6,
        ExLlamaV2Cache_Q8,
        ExLlamaV2Config
    )
except:
    ExLlamaV2 = None
    ExLlamaV2Tokenizer = None
    ExLlamaV2Cache = None
    ExLlamaV2Cache_Q4 = None
    ExLlamaV2Cache_Q6 = None
    ExLlamaV2Cache_Q8 = None
    ExLlamaV2Config = None

try:
    from llama_cpp import Llama
except:
    # optional dependency
    Llama = None

# experimental feature: tensor parallel
try:
    from exllamav2 import ExLlamaV2Cache_TP
except:
    # optional dependency
    ExLlamaV2Cache_TP = None

assert ExLlamaV2 or Llama, "Please install ExllamaV2 or LLama CPP Python as backend"

@vuminhquang
Copy link
Author

Hi,
I still get
"Please install ExllamaV2 or LLama CPP Python as backend"
For more information:

@remichu-ai
Copy link
Owner

For some strange reason, install clean from source doesnt work for version 0.2.3 for me as well, and i am using prebuilt wheel. Look like your prebuilt url was of outdated version v0.1.8 instead of v0.2.3

You can look through all the version here. Ideally match both the python version and cuda version
https://github.com/turboderp/exllamav2/releases/tag/v0.2.3

Another thing you can try is, still build from source, but install v0.2.0 instead of v0.2.3

Inside the exllamav2 folder that you clone from github. You can run the following command to check out a specific version:

git checkout tags/v0.2.0

v0.2.1 and v0.2.2 have known bugs hence we skip it. I will check the exllamav2 install again later and open an issue on exllamav2 repo if it is confirmed to be issue with their install script

@vuminhquang
Copy link
Author

Hi,
This is my updating:

  • Tried v0.2.0 of exllamav2 -> still not work
  • Tried tabbyAPI with "update_scripts/update_deps.sh" -> the server can run

I think I will wait for a couple of time before continuing to try.
Thanks.

@remichu-ai
Copy link
Owner

Hi Quang,

I have clarified with turboderp himself and couldnt figure out the issue. I have the exact issue with you where i can only use the wheel to install instead of build from source.

I resolved it by creating a new python env in conda and reinstall everything from scatch. I believe that other library that i was testing messed up with my environment.

Hope that you managed to sort out the issue on your end.

Thanks

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