mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-08-30 02:53:41 +08:00
fix + test
This commit is contained in:
parent
ab4bf05c6e
commit
00b67e2f97
@ -169,7 +169,7 @@ class BPEStreamingDetokenizer(StreamingDetokenizer):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
_byte_decoder = None
|
_byte_decoder = None
|
||||||
_space_matches = (".", "?", "!", ",", "'", "n't", "'m", "'s", "'ve", "'re")
|
_space_matches = (".", "?", "!", ",", "n't", "'m", "'s", "'ve", "'re")
|
||||||
|
|
||||||
def __init__(self, tokenizer):
|
def __init__(self, tokenizer):
|
||||||
|
|
||||||
|
@ -51,6 +51,9 @@ class TestTokenizers(unittest.TestCase):
|
|||||||
tokens = tokenizer.encode("3 3")
|
tokens = tokenizer.encode("3 3")
|
||||||
check(tokens)
|
check(tokens)
|
||||||
|
|
||||||
|
tokens = tokenizer.encode("import 'package:flutter/material.dart';")
|
||||||
|
check(tokens)
|
||||||
|
|
||||||
def test_tokenizers(self):
|
def test_tokenizers(self):
|
||||||
tokenizer_repos = [
|
tokenizer_repos = [
|
||||||
("mlx-community/Qwen1.5-0.5B-Chat-4bit", BPEStreamingDetokenizer),
|
("mlx-community/Qwen1.5-0.5B-Chat-4bit", BPEStreamingDetokenizer),
|
||||||
|
Loading…
Reference in New Issue
Block a user