Spaces:
Sleeping
Sleeping
Aaron Vattay commited on
Commit ·
bbad24e
1
Parent(s): cfd077f
It works on my michane problem
Browse files
app.py
CHANGED
|
@@ -6,6 +6,7 @@ from PIL import Image
|
|
| 6 |
from torchvision import transforms
|
| 7 |
import gradio as gr
|
| 8 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
|
|
| 9 |
class UPSC(nn.Module):
|
| 10 |
def __init__(self):
|
| 11 |
super(UPSC,self).__init__()
|
|
@@ -23,7 +24,7 @@ class UPSC(nn.Module):
|
|
| 23 |
return self.model(x)
|
| 24 |
|
| 25 |
model = UPSC().to(device)
|
| 26 |
-
model.load_state_dict(torch.load("upscaling.pth", weights_only=True))
|
| 27 |
model.eval()
|
| 28 |
|
| 29 |
def task(img):
|
|
|
|
| 6 |
from torchvision import transforms
|
| 7 |
import gradio as gr
|
| 8 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 9 |
+
print(device.type)
|
| 10 |
class UPSC(nn.Module):
|
| 11 |
def __init__(self):
|
| 12 |
super(UPSC,self).__init__()
|
|
|
|
| 24 |
return self.model(x)
|
| 25 |
|
| 26 |
model = UPSC().to(device)
|
| 27 |
+
model.load_state_dict(torch.load("upscaling.pth", weights_only=True,map_location=device))
|
| 28 |
model.eval()
|
| 29 |
|
| 30 |
def task(img):
|