Spaces:
Build error
Build error
Afonso B. Sousa
commited on
Transferred to a CPU model.
Browse files- app.py +1 -2
- models/lenet5-cpu.pt +0 -0
- models/lenet5.pkl +0 -0
- models/lenet5.pt +0 -0
- models/lenet5.ptc +0 -0
app.py
CHANGED
|
@@ -15,9 +15,8 @@ np.set_printoptions(threshold=sys.maxsize)
|
|
| 15 |
# %% app.ipynb 4
|
| 16 |
from lenet import LeNet5
|
| 17 |
# Allowlist the custom class
|
| 18 |
-
MODEL_PATH = Path("models/lenet5.pt")
|
| 19 |
model = torch.load(MODEL_PATH, weights_only=False)
|
| 20 |
-
model = model.to('cpu') # Move model to CPU
|
| 21 |
model.eval()
|
| 22 |
|
| 23 |
def predict(img):
|
|
|
|
| 15 |
# %% app.ipynb 4
|
| 16 |
from lenet import LeNet5
|
| 17 |
# Allowlist the custom class
|
| 18 |
+
MODEL_PATH = Path("models/lenet5-cpu.pt")
|
| 19 |
model = torch.load(MODEL_PATH, weights_only=False)
|
|
|
|
| 20 |
model.eval()
|
| 21 |
|
| 22 |
def predict(img):
|
models/lenet5-cpu.pt
ADDED
|
Binary file (258 kB). View file
|
|
|
models/lenet5.pkl
DELETED
|
Binary file (256 kB)
|
|
|
models/lenet5.pt
CHANGED
|
Binary files a/models/lenet5.pt and b/models/lenet5.pt differ
|
|
|
models/lenet5.ptc
DELETED
|
Binary file (270 kB)
|
|
|