char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
0a8026e76
char/aliceai-t5-moe
1#include "simple-tokenize.h" 2 3std::vector < std::string > simple_tokenize (const std::string & input ) { 4 std::vector < std::string > result ; 5 std::string current ; 6 7for (size_t i = 0 ;i < input .size ();i ++ ) { 8switch (input [i ]) { 9case ' ' : 10case '\n' : 11case '\t' : 12case '{' : 13case '}' : 14case ',' : 15case '[' : 16case '"' : 17case ']' : 18case '.' : 19case '<' : 20case '>' : 21case '=' : 22case '/' : 23if (!current .empty ()) { 24result .push_back (current ); 25current .clear (); 26 } 27default :; 28 } 29current += input [i ]; 30 } 31 32if (!current .empty ()) { 33result .push_back (current ); 34 } 35 36return result ; 37}