diff --git a/python/llm/example/CPU/PyTorch-Models/Model/llava/README.md b/python/llm/example/CPU/PyTorch-Models/Model/llava/README.md index aa44bf44e44..51894e20656 100644 --- a/python/llm/example/CPU/PyTorch-Models/Model/llava/README.md +++ b/python/llm/example/CPU/PyTorch-Models/Model/llava/README.md @@ -20,13 +20,11 @@ conda activate llm # install the latest ipex-llm nightly build with 'all' option pip install --pre --upgrade ipex-llm[all] --extra-index-url https://download.pytorch.org/whl/cpu -pip install einops # install dependencies required by llava -pip install transformers==4.36.2 - git clone https://github.com/haotian-liu/LLaVA.git # clone the llava libary -cp generate.py ./LLaVA/ # copy our example to the LLaVA folder cd LLaVA # change the working directory to the LLaVA folder git checkout tags/v1.2.0 -b 1.2.0 # Get the branch which is compatible with transformers 4.36 +pip install -e . # Install llava +cd .. ``` On Windows: @@ -36,13 +34,12 @@ conda create -n llm python=3.11 conda activate llm pip install --pre --upgrade ipex-llm[all] -pip install einops -pip install transformers==4.36.2 git clone https://github.com/haotian-liu/LLaVA.git -copy generate.py .\LLaVA\ cd LLaVA git checkout tags/v1.2.0 -b 1.2.0 +pip install -e . +cd .. ``` ### 2. Run diff --git a/python/llm/example/CPU/PyTorch-Models/Model/llava/generate.py b/python/llm/example/CPU/PyTorch-Models/Model/llava/generate.py index 780ba963ba6..1ce930dee7c 100644 --- a/python/llm/example/CPU/PyTorch-Models/Model/llava/generate.py +++ b/python/llm/example/CPU/PyTorch-Models/Model/llava/generate.py @@ -291,7 +291,8 @@ def get_stopping_criteria(conv, tokenizer, input_ids): # Load model tokenizer, model, image_processor, _ = load_pretrained_model(model_path=model_path, model_base=None, - model_name=model_name) + model_name=model_name, + device_map=None) # With only one line to enable IPEX-LLM optimization on model model = optimize_model(model)