Update RMS LayerNorm implementation, and list compr. change in chat templates (#1974)
* Update RMS LayerNorm implementation with optimizations and testing suite * perf: optimize list comprehension in get_ollama_eos_tokens
This commit is contained in:
parent
1b45ab69de
commit
6aaf377d3a
2 changed files with 1 additions and 5 deletions
|
|
@ -1512,10 +1512,7 @@ def get_ollama_eos_tokens(tokenizer, extra_eos_tokens = []):
|
|||
|
||||
# Remove duplicates
|
||||
splitted = joined_text.split("\x01\x00")
|
||||
final_eos_tokens = []
|
||||
for old, new in zip(added_tokens_decoder, splitted):
|
||||
if old == new: final_eos_tokens.append(old)
|
||||
pass
|
||||
final_eos_tokens = [old for old, new in zip(added_tokens_decoder, splitted) if old == new]
|
||||
final_eos_tokens += extra_eos_tokens
|
||||
final_eos_tokens += repeatted_tokens
|
||||
|
||||
|
|
|
|||
|
|
@ -256,7 +256,6 @@ def unpatch_rms_layernorm():
|
|||
except:
|
||||
pass
|
||||
return
|
||||
return
|
||||
pass
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue