Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
Exported with
|
| 6 |
+
|
| 7 |
+
```python
|
| 8 |
+
from optimum.neuron import NeuronFluxPipeline
|
| 9 |
+
|
| 10 |
+
if __name__ == "__main__":
|
| 11 |
+
compiler_args = {"auto_cast": "none"}
|
| 12 |
+
input_shapes = {"batch_size": 1, "height": 1024, "width": 1024}
|
| 13 |
+
|
| 14 |
+
pipe = NeuronFluxPipeline.from_pretrained(
|
| 15 |
+
"black-forest-labs/FLUX.1-dev",
|
| 16 |
+
torch_dtype=torch.bfloat16,
|
| 17 |
+
export=True,
|
| 18 |
+
tensor_parallel_size=8,
|
| 19 |
+
# disable_neuron_cache=True,
|
| 20 |
+
**compiler_args,
|
| 21 |
+
**input_shapes
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
# Save locally
|
| 25 |
+
pipe.save_pretrained("flux_dev_neuron_1024_tp8/")
|
| 26 |
+
|
| 27 |
+
# Upload to the HuggingFace Hub
|
| 28 |
+
pipe.push_to_hub(
|
| 29 |
+
"flux_dev_neuron_1024_tp8/", repository_id="Jingya/FLUX.1-dev-neuronx-1024x1024-tp8" # Replace with your HF Hub repo id
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
+
```
|