Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,11 @@ WATERMARK_TEXT = "SelamGPT"
|
|
| 10 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 11 |
TORCH_DTYPE = torch.float16 if DEVICE == "cuda" else torch.float32
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
# ===== MODEL LOADING WITH GRADIO CACHE =====
|
| 14 |
@gr.Cache() # Now works in Gradio 5.x
|
| 15 |
def load_model():
|
|
|
|
| 10 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 11 |
TORCH_DTYPE = torch.float16 if DEVICE == "cuda" else torch.float32
|
| 12 |
|
| 13 |
+
try:
|
| 14 |
+
pipe.enable_xformers_memory_efficient_attention()
|
| 15 |
+
except:
|
| 16 |
+
print("Xformers not available, using default attention")
|
| 17 |
+
|
| 18 |
# ===== MODEL LOADING WITH GRADIO CACHE =====
|
| 19 |
@gr.Cache() # Now works in Gradio 5.x
|
| 20 |
def load_model():
|