nickgardner commited on
Commit
73933e0
1 Parent(s): 5934829

try different method

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -46,7 +46,7 @@ def respond(custom_string):
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).detach().numpy()
50
  ix = np.random.choice(np.arange(out), 1, p=out)
51
  # val, ix = out[:, -1].data.topk(1)
52
 
 
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).detach()
50
  ix = np.random.choice(np.arange(out), 1, p=out)
51
  # val, ix = out[:, -1].data.topk(1)
52