Spaces:
Running
on
Zero
Running
on
Zero
Update
Browse files
app.py
CHANGED
@@ -8,6 +8,7 @@ import sys
|
|
8 |
import gradio as gr
|
9 |
import huggingface_hub
|
10 |
import PIL.Image
|
|
|
11 |
import torch
|
12 |
import torch.nn as nn
|
13 |
|
@@ -40,6 +41,7 @@ device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
|
40 |
model = load_model(device)
|
41 |
|
42 |
|
|
|
43 |
@torch.inference_mode()
|
44 |
def run(image_file: str, load_size: int = 512) -> PIL.Image.Image:
|
45 |
tensor, orig_size = read_img_path(image_file, load_size)
|
|
|
8 |
import gradio as gr
|
9 |
import huggingface_hub
|
10 |
import PIL.Image
|
11 |
+
import spaces
|
12 |
import torch
|
13 |
import torch.nn as nn
|
14 |
|
|
|
41 |
model = load_model(device)
|
42 |
|
43 |
|
44 |
+
@spaces.GPU
|
45 |
@torch.inference_mode()
|
46 |
def run(image_file: str, load_size: int = 512) -> PIL.Image.Image:
|
47 |
tensor, orig_size = read_img_path(image_file, load_size)
|