FredZhang7
commited on
Commit
·
2a32736
1
Parent(s):
eaacc51
Upload model
Browse files- Model.py +4 -0
- config.json +1 -1
Model.py
CHANGED
@@ -110,6 +110,10 @@ class InceptionV3ModelForImageClassification(PreTrainedModel):
|
|
110 |
self.eval()
|
111 |
if device == "cuda":
|
112 |
image = image.cuda()
|
|
|
|
|
|
|
|
|
113 |
with torch.no_grad():
|
114 |
out, aux = self(image)
|
115 |
print(out)
|
|
|
110 |
self.eval()
|
111 |
if device == "cuda":
|
112 |
image = image.cuda()
|
113 |
+
self.cuda()
|
114 |
+
else:
|
115 |
+
image = image.cpu()
|
116 |
+
self.cpu()
|
117 |
with torch.no_grad():
|
118 |
out, aux = self(image)
|
119 |
print(out)
|
config.json
CHANGED
@@ -43,6 +43,6 @@
|
|
43 |
0.5
|
44 |
],
|
45 |
"torch_dtype": "float32",
|
46 |
-
"transformers_version": "4.
|
47 |
"use_jit": true
|
48 |
}
|
|
|
43 |
0.5
|
44 |
],
|
45 |
"torch_dtype": "float32",
|
46 |
+
"transformers_version": "4.25.1",
|
47 |
"use_jit": true
|
48 |
}
|