Spaces:
Runtime error
Runtime error
Commit
·
7b352a4
1
Parent(s):
1b250fd
Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ delta_ckpt = torch.load(args['delta_ckpt_path'], map_location=torch.device('cpu'
|
|
28 |
model.load_state_dict(delta_ckpt, strict=False)
|
29 |
delta_ckpt = torch.load(args['anomalygpt_ckpt_path'], map_location=torch.device('cpu'))
|
30 |
model.load_state_dict(delta_ckpt, strict=False)
|
31 |
-
model = model.eval()
|
32 |
|
33 |
|
34 |
output = None
|
@@ -126,7 +126,7 @@ def predict(
|
|
126 |
history.append((input, response))
|
127 |
|
128 |
|
129 |
-
plt.imshow(pixel_output.reshape(224,224).detach().cpu(), cmap='binary_r')
|
130 |
plt.axis('off')
|
131 |
plt.savefig('output.png',bbox_inches='tight',pad_inches = 0)
|
132 |
|
|
|
28 |
model.load_state_dict(delta_ckpt, strict=False)
|
29 |
delta_ckpt = torch.load(args['anomalygpt_ckpt_path'], map_location=torch.device('cpu'))
|
30 |
model.load_state_dict(delta_ckpt, strict=False)
|
31 |
+
model = model.eval().to(torch.bfloat16)
|
32 |
|
33 |
|
34 |
output = None
|
|
|
126 |
history.append((input, response))
|
127 |
|
128 |
|
129 |
+
plt.imshow(pixel_output.to(torch.float16).reshape(224,224).detach().cpu(), cmap='binary_r')
|
130 |
plt.axis('off')
|
131 |
plt.savefig('output.png',bbox_inches='tight',pad_inches = 0)
|
132 |
|