diff --git a/README.md b/README.md index 66a6e98..b1b74f7 100644 --- a/README.md +++ b/README.md @@ -59,16 +59,33 @@ -## [Important Note!] +## [Important Note!] v1.1 <-> transformers==4.36.1 +This LLaVA-style repository has been built on `transformers==4.31.0`, which is incompatible with many new models available on Hugging Face. This requires to build a separate environment for the MLLM/LMM repository, which is somewhat troublesome for this **visual scoring** model, as we expect the **Q-Align/OneAlign** to effectively boost other disciplines (image/video generation, *etc*). Both the repository and the **AutoModel** (as follows) are updated to the newest version. -Thus, we have modified respective code for mPLUG-Owl2 to adapt it to the newest transformer version, i.e. `transformers==4.36.1`, so that you do not need to create a separate outdated environment while using it alongside other projects. The updated code is no longer compatible with the old-version Q-Align (v1.0.1/v1.0.0, and before), please update to the newest version via the following scripts: +To this end, we have modified respective code for mPLUG-Owl2 to adapt it to the newest transformer version, i.e. `transformers==4.36.1`, so that you do not need to create a separate outdated environment while using it alongside other projects. The updated code is no longer compatible with the old-version Q-Align (v1.0.1/v1.0.0, and before), please update to the newest version via the following scripts: ```shell git pull pip install -e . ``` +## [Installation Free!] Quicker Start with HuggingFace AutoModel + +No need to install this GitHub repo. + +```python +import requests +import torch +from transformers import AutoModelForCausalLM + +model = AutoModelForCausalLM.from_pretrained("q-future/one-align", trust_remote_code=True, + torch_dtype=torch.float16, device_map="auto") + +from PIL import Image +model.score([Image.open(requests.get("https://raw.githubusercontent.com/Q-Future/Q-Align/main/fig/singapore_flyer.jpg", + stream=True).raw)], task_="quality", input_="image") # task_ : quality | aesthetics; # input_: image | video +``` ## Installation @@ -88,22 +105,7 @@ pip install flash_attn --no-build-isolation ``` -## Quicker Start with HuggingFace AutoModel -No need to install this GitHub repo. - -```python -import requests -import torch -from transformers import AutoModelForCausalLM - -model = AutoModelForCausalLM.from_pretrained("q-future/one-align", trust_remote_code=True, - torch_dtype=torch.float16, device_map="auto") - -from PIL import Image -model.score([Image.open(requests.get("https://raw.githubusercontent.com/Q-Future/Q-Align/main/fig/singapore_flyer.jpg", - stream=True).raw)], task_="quality", input_="image") # task_ : quality | aesthetics; # input_: image | video -``` ## Quick Start We have fixed the multi-GPU inference problem.