Skip to content

Commit

Permalink
update auto device map for AutoModel
Browse files Browse the repository at this point in the history
  • Loading branch information
teowu committed Jan 3, 2024
1 parent d12e72f commit 89df28a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,16 @@ import torch
from transformers import AutoModelForCausalLM

model = AutoModelForCausalLM.from_pretrained("q-future/one-align", trust_remote_code=True,
torch_dtype=torch.float16, device_map={"":"cuda:0"})
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.

### Image Quality Scorer

- CLI Interface
Expand Down

0 comments on commit 89df28a

Please sign in to comment.