Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for automatic device mapping by introducing a new parameter ("use_auto") in various parts of the codebase. Key changes include:
- Updating the language model initialization to use the model's device.
- Adding a new "use_auto" parameter to be passed in the inference and model loading routines.
- Documenting the new "use_auto" option in the README.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| syncode/language_model.py | Update device assignment by using self.model.device instead of a passed device. |
| syncode/infer.py | Introduced a new "use_auto" flag in function signatures and method calls to pass through the device mapping setting. |
| syncode/common.py | Extended load_model to support auto device mapping based on the "use_auto" flag. |
| README.md | Documentation update to include the new "use_auto" CLI option. |
Comments suppressed due to low confidence (2)
syncode/infer.py:53
- [nitpick] Consider renaming 'use_auto' to a more descriptive name such as 'use_auto_device_mapping' to clarify its purpose.
use_auto: bool = False,
syncode/common.py:14
- [nitpick] Consider renaming the parameter 'use_auto' to a more descriptive name (e.g., 'use_auto_device_mapping') to enhance clarity across the codebase.
def load_model(model_name, device, quantize, use_auto = False):
shubhamugare
approved these changes
Apr 2, 2025
Collaborator
shubhamugare
left a comment
There was a problem hiding this comment.
Looks Good! Let me merge it once the tests pass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #142