Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Usage]: How to set a dynamic temperature when sampling? (decrease gradually as more tokens generated) #11276

Open
1 task done
StarDewXXX opened this issue Dec 18, 2024 · 1 comment
Labels
usage How to use vllm

Comments

@StarDewXXX
Copy link

StarDewXXX commented Dec 18, 2024

How would you like to use vllm

I want to set a dynamic temperature when sampling. Specifically, I need to dynamically adjust the temperature coefficient based on the length of the currently generated token each time the logits are processed. It seems that sampling_params cannot achieve this feature. Which part of the code should I modify?

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.
@StarDewXXX StarDewXXX added the usage How to use vllm label Dec 18, 2024
@noooop
Copy link
Contributor

noooop commented Dec 18, 2024

Get the temperature from sampling_params

here:

temperature = sampling_params.temperature

but I guess vllm has a caching mechanism.

Maybe it needs to be closed or I don’t know any good way bypass.

https://github.com/vllm-project/vllm/blob/f04e407e6b6b9ce65c16cffda836f05c2ad32682/vllm/model_executor/layers/sampler.py#L241C1-L250C1

Modifying such deep code is always hard, good luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usage How to use vllm
Projects
None yet
Development

No branches or pull requests

2 participants