Spaces:
Runtime error
Runtime error
nickgardner
commited on
Commit
•
304e451
1
Parent(s):
55360ff
try this
Browse files
app.py
CHANGED
@@ -47,8 +47,7 @@ def respond(custom_string):
|
|
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 |
-
|
51 |
-
ix = np.random.choice(np.arange(out), 1, p=out)
|
52 |
# val, ix = out[:, -1].data.topk(1)
|
53 |
|
54 |
outputs[i] = ix[0][0]
|
|
|
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]), 1, p=out[:, -1])
|
|
|
51 |
# val, ix = out[:, -1].data.topk(1)
|
52 |
|
53 |
outputs[i] = ix[0][0]
|