Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/pytorch/diffusion_model/diffusers/flux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ This example quantizes and validates the accuracy of Flux.

```shell
pip install -r requirements.txt
# Use `INC_PT_ONLY=1 pip install git+https://github.com/intel/neural-compressor.git@v3.6rc` for the latest updates before neural-compressor v3.6 release
pip install neural-compressor-pt==3.6
# Use `pip install git+https://github.com/intel/auto-round.git@v0.8.0rc2` for the latest updates before auto-round v0.8.0 release
pip install auto-round==0.8.0
# Use `INC_PT_ONLY=1 pip install git+https://github.com/intel/neural-compressor.git@master` for the latest updates before neural-compressor v3.6 release
pip install neural-compressor-pt==3.7
# Use `pip install git+https://github.com/intel/auto-round.git@main` for the latest updates before auto-round v0.8.0 release
pip install auto-round==0.9.3
```

## 2. Prepare Model
Expand Down
6 changes: 3 additions & 3 deletions examples/pytorch/diffusion_model/diffusers/flux/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def inference_worker(eval_file, pipe, image_save_dir):
output.images[idx].save(os.path.join(image_save_dir, str(image_id) + ".png"))


def tune():
pipe = AutoPipelineForText2Image.from_pretrained(args.model, torch_dtype=torch.bfloat16)
def tune(device):
pipe = AutoPipelineForText2Image.from_pretrained(args.model, torch_dtype=torch.bfloat16).to(device)
model = pipe.transformer
layer_config = {}
kwargs = {}
Expand Down Expand Up @@ -116,7 +116,7 @@ def tune():

if args.quantize:
print(f"Start to quantize {args.model}.")
tune()
tune(device)
exit(0)

if args.inference:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function run_benchmark {

echo "Start calculating final score..."

python3 main.py --output_image_path ${output_image_path} --accuracy
python3 main.py --output_image_path ${output_image_path} --accuracy --eval_dataset ${dataset_location}
}

main "$@"