Spaces:
Running
on
Zero
Running
on
Zero
changes for ZeroGPU
#44
by
linoyts
HF Staff
- opened
app.py
CHANGED
|
@@ -2,6 +2,7 @@ import diffusers
|
|
| 2 |
import gradio as gr
|
| 3 |
import torch
|
| 4 |
from diffusers import AutoPipelineForInpainting
|
|
|
|
| 5 |
|
| 6 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 7 |
pipe = AutoPipelineForInpainting.from_pretrained(
|
|
@@ -18,7 +19,7 @@ def read_content(file_path: str) -> str:
|
|
| 18 |
|
| 19 |
return content
|
| 20 |
|
| 21 |
-
|
| 22 |
def predict(
|
| 23 |
input_image,
|
| 24 |
prompt="",
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import torch
|
| 4 |
from diffusers import AutoPipelineForInpainting
|
| 5 |
+
import spaces
|
| 6 |
|
| 7 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 8 |
pipe = AutoPipelineForInpainting.from_pretrained(
|
|
|
|
| 19 |
|
| 20 |
return content
|
| 21 |
|
| 22 |
+
@spaces.GPU()
|
| 23 |
def predict(
|
| 24 |
input_image,
|
| 25 |
prompt="",
|