Merge branch 'adding-support-for-mamba2' of https://github.com/Goekdeniz-Guelmez/mlx-examples into adding-support-for-mamba2

This commit is contained in:
Goekdeniz-Guelmez 2024-10-22 18:26:05 +02:00
commit 5326d9373a

View File

@ -193,7 +193,9 @@ class BPEStreamingDetokenizer(StreamingDetokenizer):
self.tokens = []
def _maybe_trim_space(self, current_text):
if current_text[0] != " ":
if len(current_text) == 0:
return current_text
elif current_text[0] != " ":
return current_text
elif not self.text:
return current_text[1:]