# Generate() speculative decoding with static string

**URL:** <https://discuss.huggingface.co/t/generate-speculative-decoding-with-static-string/134676>\
**Category:** 🤗Transformers\
**Created:** [January 7, 2025, 4:46pm UTC](https://discuss.huggingface.co/t/generate-speculative-decoding-with-static-string/134676 "2025-01-07T16:46:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bstee615](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/bstee615/32/43502_2.png) [@bstee615](https://discuss.huggingface.co/u/bstee615)\
**Post date:** [January 7, 2025, 4:46pm UTC](https://discuss.huggingface.co/t/generate-speculative-decoding-with-static-string/134676/1 "2025-01-07T16:46:57Z")

</div>

Hi! I would like to use the speculative decoding available in generate() with the [assistant\_model parameter](https://huggingface.co/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate.assistant_model), for editing a piece of text. However, rather than using another model, I want to use a static string: the text that I am editing. This way, I can add the strong assumption that the output text will be very similar to the input text, and the model’s generations will only be edits of portions of the original text. Is this supported in generate()?
