Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,7 @@
|
|
1 |
import torch
|
2 |
from PIL import Image
|
3 |
import gradio as gr
|
4 |
-
import
|
5 |
-
|
6 |
from KandiSuperRes import get_SR_pipeline
|
7 |
|
8 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
@@ -10,6 +9,7 @@ sr_pipe2x = get_SR_pipeline(device=device, fp16=True, flash=True, scale=2)
|
|
10 |
sr_pipe4x = get_SR_pipeline(device=device, fp16=True, flash=True, scale=4)
|
11 |
|
12 |
|
|
|
13 |
def inference(image, size):
|
14 |
if image is None:
|
15 |
raise gr.Error("Image not uploaded")
|
|
|
1 |
import torch
|
2 |
from PIL import Image
|
3 |
import gradio as gr
|
4 |
+
import spaces
|
|
|
5 |
from KandiSuperRes import get_SR_pipeline
|
6 |
|
7 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
|
|
9 |
sr_pipe4x = get_SR_pipeline(device=device, fp16=True, flash=True, scale=4)
|
10 |
|
11 |
|
12 |
+
@spaces.GPU()
|
13 |
def inference(image, size):
|
14 |
if image is None:
|
15 |
raise gr.Error("Image not uploaded")
|