-
Notifications
You must be signed in to change notification settings - Fork 17
add default_sampling_params #211
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @pathfinder-pf, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the engine's capabilities by integrating a mechanism to manage default sampling parameters. It introduces a dedicated attribute to store these parameters and a method to retrieve them efficiently, ensuring that the engine can consistently apply predefined sampling configurations. This change aims to streamline the use of default sampling settings, making the engine more flexible and user-friendly. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The pull request introduces a new method get_default_sampling_params
to the Engine
class to provide default sampling parameters. However, the implementation has several critical issues that will cause runtime errors, such as referencing non-existent attributes and methods. The code needs to be corrected to properly fetch the configuration from the backend, likely via an RPC call.
def get_default_sampling_params(self) -> SamplingParams: | ||
if self.default_sampling_params is None: | ||
self.default_sampling_params = ( | ||
self.llm_engine.model_config.get_diff_sampling_param()) | ||
if self.default_sampling_params: | ||
return SamplingParams.from_optional(**self.default_sampling_params) | ||
return SamplingParams() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new method has several issues that will cause it to fail at runtime:
self.llm_engine
is not an attribute of theEngine
class. TheEngine
class acts as a client and does not hold a reference to theLLMEngine
instance, which runs in a separate process.- The
ModelConfig
class does not have a method namedget_diff_sampling_param
. This call will result in anAttributeError
. - The
SamplingParams
class does not have a class method namedfrom_optional
. This will also raise anAttributeError
.
It seems the intention is to fetch default sampling parameters from the model's configuration. This likely requires fetching this information from the scheduler process, for example by introducing a new RPC call.
Additionally, the logic if self.default_sampling_params:
might be incorrect if an empty dictionary is a valid return value for sampling parameters, as it would evaluate to False
. You might want to check for is not None
instead.
To instantiate SamplingParams
from a dictionary, you can use its constructor directly, e.g., SamplingParams(**params_dict)
.
No description provided.