Update app.py
Browse files
app.py
CHANGED
|
@@ -105,7 +105,7 @@ def generate_tokens(
|
|
| 105 |
|
| 106 |
# Decrypt: apply sigma_inv to get plain hidden state
|
| 107 |
last_hidden = torch.tensor(body["last_hidden"], dtype=torch.float32) # (1, seq, hidden)
|
| 108 |
-
past_key_values = body
|
| 109 |
|
| 110 |
# Take only the last position
|
| 111 |
last_pos = last_hidden[:, -1:, :] # (1, 1, hidden) sigma-space
|
|
|
|
| 105 |
|
| 106 |
# Decrypt: apply sigma_inv to get plain hidden state
|
| 107 |
last_hidden = torch.tensor(body["last_hidden"], dtype=torch.float32) # (1, seq, hidden)
|
| 108 |
+
past_key_values = body.get("past_key_values") # may be None
|
| 109 |
|
| 110 |
# Take only the last position
|
| 111 |
last_pos = last_hidden[:, -1:, :] # (1, 1, hidden) sigma-space
|