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

pip install missing dependencies #15

Open VincyZhang opened 6 months ago

VincyZhang commented 6 months ago

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 6 months ago

To add the required dependencies to setup.py, you can include the following lines:

# Add the required dependencies to setup.py as deps
deps = [
    "accelerate",
    "neural-speed",
    "gguf",
    # Add any other missing packages here
]

Now, when you create a new conda environment and install intel-extension-for-transformers, these dependencies will be automatically installed along with it. If you need help, please @NeuralChatBot

VincyZhang commented 6 months ago

This requirements need to be installed before running an model, intel-extension-for-transformers/requirements.txt at main · intel/intel-extension-for-transformers (github.com) Usually we suggest install dependency before running example. But I notice some just want to try our quick sample in Readme, and find out some dependencies are missing.

VincyZhang commented 6 months ago

@NeuralChatBot

NeuralChatBot commented 6 months ago

To address this issue, you can consider adding the missing dependencies to the requirements.txt file in the intel-extension-for-transformers repository. This will ensure that anyone who clones the repository and runs the examples will have all the necessary dependencies installed.