Spaces:
Runtime error
Runtime error
Commit
·
c654b20
1
Parent(s):
3eef4e8
how:
Browse files
app.py
CHANGED
@@ -46,7 +46,7 @@ def respond(input):
|
|
46 |
trg_mask = torch.autograd.Variable(torch.from_numpy(trg_mask) == 0).to(device)
|
47 |
|
48 |
out = model.out(model.decoder(outputs[:i].unsqueeze(0), e_outputs, src_mask, trg_mask))
|
49 |
-
out = torch.nn.functional.softmax(out, dim=-1)[:, -1].detach().numpy()
|
50 |
print(out.shape)
|
51 |
print(np.sum(out))
|
52 |
ix = np.random.choice(np.arange(len(out)), 1, p=out)
|
|
|
46 |
trg_mask = torch.autograd.Variable(torch.from_numpy(trg_mask) == 0).to(device)
|
47 |
|
48 |
out = model.out(model.decoder(outputs[:i].unsqueeze(0), e_outputs, src_mask, trg_mask))
|
49 |
+
out = torch.nn.functional.softmax(out, dim=-1)[:, -1].squeeze().detach().numpy()
|
50 |
print(out.shape)
|
51 |
print(np.sum(out))
|
52 |
ix = np.random.choice(np.arange(len(out)), 1, p=out)
|