VincyZhang / intel-extension-for-transformers

Extending Hugging Face transformers APIs for Transformer-based models and improve the productivity of inference deployment. With extremely compressed models, the toolkit can greatly improve the inference efficiency on Intel platforms.
Apache License 2.0
0 stars 0 forks source link

missing dependencies #29

Closed VincyZhang closed 3 months ago

VincyZhang commented 4 months ago

Describe the issue When I use pip install intel-extension-for-transformers in a fresh conda environment, there are some packages missing that I have to manually install before I can run a model.

Please add these to setup.py as deps!

To reproduce, simply:

from intel_extension_for_transformers.transformers import AutoModelForCausalLM

model_name = "meta-llama/Llama-2-7b-hf"

model = AutoModelForCausalLM.from_pretrained(model_name, load_in_4bit=True)
NeuralChatBot commented 4 months ago

The issue you're experiencing is due to the fact that the intel-extension-for-transformers package is not properly handling the installation of its dependencies. It seems that the package is not listing its dependencies in its setup.py file, which means that when you install it, it doesn't know what dependencies to install.

To fix this, you need to add the missing dependencies to the setup.py file. Here's how you can do it:

  1. Open the setup.py file in the intel-extension-for-transformers package.
  2. Look for the install_requires variable. This is where you should add the missing dependencies.
  3. Add the missing dependencies to the install_requires list.

Here's an example of what the install_requires list might look like after adding the missing dependencies:

install_requires=[
    "accelerate",
    "neural-speed",
    "gguf",
    # other dependencies...
],

After you've made these changes, you should be able to install the intel-extension-for-transformers package and its dependencies using pip:

pip install intel-extension-for-transformers

This should install all the necessary dependencies for the package to work correctly.

Please note that this is a workaround and may not be the best solution. The package maintainers should consider adding the missing dependencies to the setup.py file.

If you need help, please @NeuralChatBot