Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from PIL import Image
|
| 3 |
from rembg import remove
|
|
|
|
| 4 |
|
|
|
|
| 5 |
def process_image(image):
|
| 6 |
if image is None:
|
| 7 |
return None
|
|
@@ -22,4 +24,4 @@ with gr.Blocks(title="AdSpin Studio") as demo:
|
|
| 22 |
|
| 23 |
generate_btn.click(fn=process_image, inputs=input_img, outputs=output_img)
|
| 24 |
|
| 25 |
-
demo.launch(
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from PIL import Image
|
| 3 |
from rembg import remove
|
| 4 |
+
import spaces # <--- This fixes the GPU error
|
| 5 |
|
| 6 |
+
@spaces.GPU # <--- Tells Hugging Face we are using the free processor
|
| 7 |
def process_image(image):
|
| 8 |
if image is None:
|
| 9 |
return None
|
|
|
|
| 24 |
|
| 25 |
generate_btn.click(fn=process_image, inputs=input_img, outputs=output_img)
|
| 26 |
|
| 27 |
+
demo.launch()
|