Skip to content
Python

fixed prompt enhancer crash

DeepBeepMeepfc67321e7ecc
diff --git a/README.md b/README.md
index 73ea784..c6c71d0 100644
--- a/README.md
+++ b/README.md
@@ -241,7 +241,7 @@ pip install torch==2.10.0 torchvision torchaudio --index-url https://download.py
pip install -r requirements.txt
```
-If kep the same conda environement / python version, you will have as well to uninstall / reinstall *Sage Attention*, *Triton*, *Flash Attention* (if installed) otherwise you will get some errors when launching the app since they were compiled for an earlier version of Pytorch.
+If kept the same conda environement / python version, you will have as well to uninstall / reinstall *Sage Attention*, *Triton*, *Flash Attention* (if installed) otherwise you will get some errors when launching the app since these libraries were compiled for an earlier version of Pytorch. Check the **[Installation Guide](docs/INSTALLATION.md)** -
if you get some error messages related to git, you may try the following (beware this will overwrite local changes made to the source code of WanGP):
```bash
diff --git a/wgp.py b/wgp.py
index 6520636..4188466 100644
--- a/wgp.py
+++ b/wgp.py
@@ -3377,7 +3377,9 @@ def setup_prompt_enhancer(pipe, kwargs):
prompt_enhancer_llm_tokenizer = AutoTokenizer.from_pretrained(fl.locate_folder("llama-joycaption-beta-one-hf-llava"))
prompt_enhancer_llm_model.generation_config.pad_token = prompt_enhancer_llm_tokenizer.eos_token
- prompt_enhancer_llm_model.generation_config.pad_token_id = prompt_enhancer_llm_model.generation_config.eos_token_id[0]
+ if prompt_enhancer_llm_model.generation_config.pad_token_id is None:
+ eos_token_id = prompt_enhancer_llm_model.generation_config.eos_token_id
+ prompt_enhancer_llm_model.generation_config.pad_token_id = eos_token_id [0] if isinstance(eos_token_id,list) else eos_token_id
prompt_enhancer_llm_model.eval()
pipe["prompt_enhancer_llm_model"] = prompt_enhancer_llm_model