Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,4 @@
|
|
| 1 |
import os
|
| 2 |
-
import subprocess
|
| 3 |
-
import sys
|
| 4 |
import io
|
| 5 |
import gradio as gr
|
| 6 |
import numpy as np
|
|
@@ -15,8 +13,6 @@ import json
|
|
| 15 |
import base64
|
| 16 |
from huggingface_hub import InferenceClient
|
| 17 |
|
| 18 |
-
subprocess.check_call([sys.executable, "-m", "pip", "install", "spaces==0.43.0"])
|
| 19 |
-
|
| 20 |
dtype = torch.bfloat16
|
| 21 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 22 |
|
|
@@ -80,8 +76,9 @@ pipe = Flux2Pipeline.from_pretrained(
|
|
| 80 |
)
|
| 81 |
pipe.to(device)
|
| 82 |
|
| 83 |
-
#
|
| 84 |
-
|
|
|
|
| 85 |
|
| 86 |
def image_to_data_uri(img):
|
| 87 |
buffered = io.BytesIO()
|
|
|
|
| 1 |
import os
|
|
|
|
|
|
|
| 2 |
import io
|
| 3 |
import gradio as gr
|
| 4 |
import numpy as np
|
|
|
|
| 13 |
import base64
|
| 14 |
from huggingface_hub import InferenceClient
|
| 15 |
|
|
|
|
|
|
|
| 16 |
dtype = torch.bfloat16
|
| 17 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 18 |
|
|
|
|
| 76 |
)
|
| 77 |
pipe.to(device)
|
| 78 |
|
| 79 |
+
# AOTI blocks temporarily disabled - HuggingFace needs to recompile for new ZeroGPU environment (PyTorch 2.9 + CUDA 12.8)
|
| 80 |
+
# Re-enable once zerogpu-aoti/FLUX.2 is updated with compatible compiled blocks
|
| 81 |
+
# spaces.aoti_blocks_load(pipe.transformer, "zerogpu-aoti/FLUX.2", variant="fa3")
|
| 82 |
|
| 83 |
def image_to_data_uri(img):
|
| 84 |
buffered = io.BytesIO()
|