Instructions to use naapeli/chess-puzzle-generator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use naapeli/chess-puzzle-generator with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("naapeli/chess-puzzle-generator", dtype=torch.bfloat16, device_map="cuda") prompt = "My name is Julien and I like to" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Release main
Browse files- README.md +2 -2
- pipeline.py +1 -1
README.md
CHANGED
|
@@ -51,7 +51,7 @@ pipeline(
|
|
| 51 |
steps: int = 256,
|
| 52 |
temperature: float = 1.0,
|
| 53 |
schedule: str | Schedule = Schedule.linear,
|
| 54 |
-
generate_move_last: bool =
|
| 55 |
) -> list[Position]
|
| 56 |
```
|
| 57 |
|
|
@@ -90,7 +90,7 @@ pipeline(
|
|
| 90 |
- `pipeline.Schedule.geometric` (`"geometric"`)
|
| 91 |
- `pipeline.Schedule.polynomial` (`"polynomial"`)
|
| 92 |
|
| 93 |
-
- **`generate_move_last`** (`bool`, optional, default: `
|
| 94 |
When `True`, the model first generates the full 64-square board position across `steps`, and then unmasks the 5 solution move tokens in a subsequent phase.
|
| 95 |
|
| 96 |
### Return Value
|
|
|
|
| 51 |
steps: int = 256,
|
| 52 |
temperature: float = 1.0,
|
| 53 |
schedule: str | Schedule = Schedule.linear,
|
| 54 |
+
generate_move_last: bool = False,
|
| 55 |
) -> list[Position]
|
| 56 |
```
|
| 57 |
|
|
|
|
| 90 |
- `pipeline.Schedule.geometric` (`"geometric"`)
|
| 91 |
- `pipeline.Schedule.polynomial` (`"polynomial"`)
|
| 92 |
|
| 93 |
+
- **`generate_move_last`** (`bool`, optional, default: `False`):
|
| 94 |
When `True`, the model first generates the full 64-square board position across `steps`, and then unmasks the 5 solution move tokens in a subsequent phase.
|
| 95 |
|
| 96 |
### Return Value
|
pipeline.py
CHANGED
|
@@ -396,7 +396,7 @@ class ChessPuzzlePipeline(DiffusionPipeline):
|
|
| 396 |
steps: int = 256,
|
| 397 |
temperature: float = 1.0,
|
| 398 |
schedule: str | Schedule = Schedule.linear,
|
| 399 |
-
generate_move_last: bool =
|
| 400 |
):
|
| 401 |
device = self.device
|
| 402 |
self.model.eval()
|
|
|
|
| 396 |
steps: int = 256,
|
| 397 |
temperature: float = 1.0,
|
| 398 |
schedule: str | Schedule = Schedule.linear,
|
| 399 |
+
generate_move_last: bool = False,
|
| 400 |
):
|
| 401 |
device = self.device
|
| 402 |
self.model.eval()
|