rope theta for llama model

This commit is contained in:
Awni Hannun
2023-12-15 19:30:49 -08:00
parent db134d976d
commit 4656b1d5e3
2 changed files with 30 additions and 3 deletions

View File

@@ -206,7 +206,10 @@ if __name__ == "__main__":
if (len(tokens) % 10) == 0:
mx.eval(tokens)
eos_index = next((i for i, t in enumerate(tokens) if t.item() == tokenizer.eos_token_id), None)
eos_index = next(
(i for i, t in enumerate(tokens) if t.item() == tokenizer.eos_token_id),
None,
)
if eos_index is not None:
tokens = tokens[:eos_index]