How to get the score of each token when using pipeline
pipe = pipeline( "text-generation", model=model, tokenizer=tokenizer, max_new_tokens=512, do_sample=True, temperature=0.7, top_p=0.95, top_k=40, repetition_penalty=1.1, output_scores=True )
The model I use is Qwen2-7B-Instruct. When I try to output the score of each token by modifying the parameters, it doesn't work.
Hey! You might want return_dict_in_generate see https://huggingface.co/docs/transformers/en/internal/generation_utils#generate-outputs
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
HI, Have you found a way now? How to get the score of each token when using pipeline? @xin0623