David Koski
David Koski
Specifically the code is looking for either the unknown token or the eos token: ```swift if t == tokenizer.unknownTokenId || t == tokenizer.eosTokenId { ``` https://github.com/ml-explore/mlx-swift-examples/blob/main/Libraries/LLM/Evaluate.swift#L199 The `didGenerate` block that...
It may be related to this: https://github.com/huggingface/swift-transformers/issues/92 -- we are not passing in a proper prompt and the generation may be impacted. That issue is a bit terse but basically...
That actually looks "right": ``` python -m mlx_lm.generate --model ~/Documents/huggingface/models/mlx-community/phi-2-hf-4bit-mlx --prompt 'Instruct: what is your name?. Output: ' Special tokens have been added in the vocabulary, make sure the associated...
It looks like phi2 can't answer that prompt -- maybe it doesn't cover that info or maybe it is tool small? `mistral7B4bit` aka `mlx-community/Mistral-7B-v0.1-hf-4bit-mlx` seems to do an ok job,...
This looks a bit like: - https://github.com/huggingface/swift-transformers/pull/52 - https://github.com/huggingface/swift-transformers/issues/51 What version (hash) of `swift-transformers` are you using?
OK, that is the current head of main and includes that fix. Oh, interesting -- that particular prompt does reproduce it for me! Here is the token in question: ```swift...
I had a thought about how this might be fixed -- we might be able to make something along these lines: ```swift struct CodePointString : StringProtocol { let value: String...
You aren't missing anything, the implementation falls slightly short. Perhaps `registry` should not be public (expose via a function?) or maybe it can be done with a lazy property. Right...
Yeah, here are some ideas that I wrote for somebody else working on LLMs: - install the llms/mlx_lm code from https://github.com/ml-explore/mlx-examples - this gives you a working python version that...
If you feed the python tokens in the swift model does it produce the expected output? Yeah, it may be that there is more to the Qwen tokenizer. There must...