Open yangzhj53 opened 8 months ago
I read the code and I found a trick to solve it. After encoding, the id of '\n' is 13. The program will generate a batch of token_id each time, and I just need to check if 13 appears in all positions for two times.
Maybe use the stop_token
in generate()
?
Use </s>
as end of string token in the generation
When I use codellama or codellama-python to finish the continuation of a prompt, a lot of '\n' are outputed in the end until it reaches the max_gen_len. Is there any way to let it stop early except limiting the max_gen_len which is not convenient?