Rope theta to support Coda Llama (#121)

* rope theta for llama model

* llama chat/code

* nit
This commit is contained in:
Awni Hannun
2023-12-15 19:51:51 -08:00
committed by GitHub
parent db134d976d
commit 08e862336a
3 changed files with 32 additions and 4 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]