Instructions to use Joypop/GDPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Joypop/GDPO with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Joypop/GDPO", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -66,14 +66,16 @@ Download the [OpenImage dataset](https://storage.googleapis.com/openimages/web/i
|
|
| 66 |
|
| 67 |
|
| 68 |
### Step2: Train NAOSD.
|
| 69 |
-
|
| 70 |
bash scripts/train/train_NAOSD.sh
|
| 71 |
-
|
|
|
|
| 72 |
|
| 73 |
### Step3: Train GDPO-SR
|
| 74 |
-
|
| 75 |
bash scripts/train/train_GDPOSR.sh
|
| 76 |
-
|
|
|
|
| 77 |
|
| 78 |
## π Citations
|
| 79 |
|
|
|
|
| 66 |
|
| 67 |
|
| 68 |
### Step2: Train NAOSD.
|
| 69 |
+
```
|
| 70 |
bash scripts/train/train_NAOSD.sh
|
| 71 |
+
```
|
| 72 |
+
The hyperparameters in train_NAOSD.sh can be modified to suit different experimental settings. Besides, after training with NAOSD, you can use GDPOSR/mergelora.py to merge the LoRA into the UNet and VAE as base model for subsequent reinforcement learning training and inference.
|
| 73 |
|
| 74 |
### Step3: Train GDPO-SR
|
| 75 |
+
```
|
| 76 |
bash scripts/train/train_GDPOSR.sh
|
| 77 |
+
```
|
| 78 |
+
The hyperparameters in train_GDPOSR.sh can be modified to suit different experimental settings. Besides, after training with GDPO-SR, you can use GDPOSR/mergelora.py to merge the LoRA into the UNet for subsequent inference.
|
| 79 |
|
| 80 |
## π Citations
|
| 81 |
|