Upload modeling_olifant.py with huggingface_hub
Browse files- modeling_olifant.py +2 -2
modeling_olifant.py
CHANGED
|
@@ -288,8 +288,8 @@ class OlifantForCausalLM(PreTrainedModel):
|
|
| 288 |
|
| 289 |
# For each position, predict next token using sliding window
|
| 290 |
for pos in range(seq_len):
|
| 291 |
-
# Get context window
|
| 292 |
-
context_tokens = tokens[max(0, pos - self.config.window_size):pos]
|
| 293 |
|
| 294 |
# Pad context to window size
|
| 295 |
padded_context = self._pad_prompt(context_tokens, self.config.window_size)
|
|
|
|
| 288 |
|
| 289 |
# For each position, predict next token using sliding window
|
| 290 |
for pos in range(seq_len):
|
| 291 |
+
# Get context window including current position (to predict next token)
|
| 292 |
+
context_tokens = tokens[max(0, pos + 1 - self.config.window_size):pos + 1]
|
| 293 |
|
| 294 |
# Pad context to window size
|
| 295 |
padded_context = self._pad_prompt(context_tokens, self.config.window_size)
|