File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -137,11 +137,19 @@ fn main() -> Result<()> {
137
137
for ( i, token_line) in tokens_lines_list. iter ( ) . enumerate ( ) {
138
138
eprintln ! ( "Prompt {i}" ) ;
139
139
for token in token_line {
140
- eprintln ! ( " {} --> {}" , token, model. token_to_str( * token) ?) ;
140
+ // Attempt to convert token to string and print it; if it fails, print the token instead
141
+ match model. token_to_str ( * token) {
142
+ Ok ( token_str) => eprintln ! ( "Token string: {}" , token_str) ,
143
+ Err ( e) => {
144
+ eprintln ! ( "Failed to convert token to string, error: {}" , e) ;
145
+ eprintln ! ( "Token value: {}" , token) ;
146
+ }
147
+ }
141
148
}
142
149
eprintln ! ( ) ;
143
150
}
144
151
152
+
145
153
std:: io:: stderr ( ) . flush ( ) ?;
146
154
147
155
// create a llama_batch with the size of the context
You can’t perform that action at this time.
0 commit comments