Spaces:
Runtime error
Runtime error
hcs
commited on
Commit
·
3f481af
1
Parent(s):
475ac6e
Add application file
Browse files- 1_upload.sh +3 -0
- core.py +1 -3
- requirements.txt +2 -0
1_upload.sh
CHANGED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
git add .
|
2 |
+
git commit -m "Add application file"
|
3 |
+
git push
|
core.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import torchvision.transforms as transforms
|
2 |
from PIL import Image
|
3 |
import Nets
|
@@ -12,9 +13,6 @@ def load_model(pretrained_dict, new):
|
|
12 |
new.load_state_dict(model_dict)
|
13 |
|
14 |
|
15 |
-
import torch
|
16 |
-
|
17 |
-
# 检查GPU可用性
|
18 |
if not torch.cuda.is_available():
|
19 |
device = torch.device("cuda")
|
20 |
else:
|
|
|
1 |
+
import torch
|
2 |
import torchvision.transforms as transforms
|
3 |
from PIL import Image
|
4 |
import Nets
|
|
|
13 |
new.load_state_dict(model_dict)
|
14 |
|
15 |
|
|
|
|
|
|
|
16 |
if not torch.cuda.is_available():
|
17 |
device = torch.device("cuda")
|
18 |
else:
|
requirements.txt
CHANGED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
torch==1.13.1
|
2 |
+
torchvision==0.14.1
|