File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -859,7 +859,7 @@ def complete_text(text):
859859 half_sample ,
860860 add_special_tokens = False
861861 )['input_ids' ]
862-
862+
863863 generated_tokens = generator .generate (
864864 token_ids = token_ids , # Just the actual tokens, no padding
865865 do_sample = False ,
@@ -904,8 +904,9 @@ def complete_text(text):
904904 )
905905
906906 # Decode the result
907+ half_sample = tokenizer .decode (half_sample_tokenized )
907908 full_generated_text = tokenizer .decode (generated_tokens , skip_special_tokens = False )
908- print (f"PROMPT number { counter } : { half_sample } ; RESPONSE: { full_generated_text .replace ()} " )
909+ print (f"PROMPT number { counter } : { half_sample } ; RESPONSE: { full_generated_text .replace (half_sample , "" )} " )
909910 counter += 1
910911
911912
You can’t perform that action at this time.
0 commit comments