-
Notifications
You must be signed in to change notification settings - Fork 49
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
Multi lora inference #12
Conversation
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.
❌ Changes requested. Reviewed everything up to 0ea52ad in 26 seconds
More details
- Looked at
911
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. weights.py:87
- Draft comment:
Consider adding a more descriptive error message or handling for URLs that do not end with.tar
or.safetensors
to improve robustness. - Reason this comment was not posted:
Confidence changes required:50%
Thedownload_weights_url
function inweights.py
is responsible for downloading files based on their extensions. However, it does not handle URLs that end with neither.tar
nor.safetensors
, which could lead to unexpected errors if such URLs are passed. This should be addressed to ensure robustness.
2. predict.py:316
- Draft comment:
Thedownload_weights
function is defined but not used in this file. Consider removing it if it's redundant, as it seems to duplicate functionality fromweights.py
. - Reason this comment was not posted:
Confidence changes required:50%
Thedownload_weights
function inpredict.py
is defined but not used within the file. It seems to be a duplicate of the function inweights.py
. This redundancy should be addressed to avoid confusion and maintain code clarity.
3. predict.py:125
- Draft comment:
Thelora_scale
parameter allows negative values, which might not be intended. Consider restricting the range to non-negative values if negative scaling is not supported. - Reason this comment was not posted:
Confidence changes required:50%
Inpredict.py
, thelora_scale
parameter has a default value of 1.0, but the range allows for negative values. This might not be intended, as negative scaling could lead to unexpected behavior.
4. predict.py:263
- Draft comment:
Theload_single_lora
function usesmodel
to accessself.pipes
, but it should usepipe
directly as passed to the function. Consider updating the function to usepipe
instead ofself.pipes[model]
. - Reason this comment was not posted:
Confidence changes required:50%
Inpredict.py
, theload_single_lora
function uses themodel
parameter to accessself.pipes
, but it should be usingpipe
directly as passed to the function. This is a logical inconsistency that should be corrected.
Workflow ID: wflow_lrvABZCTIzCU7qlF
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
predict.py
Outdated
main_lora_path = self.weights_cache.ensure(main_lora_url) | ||
pipe.load_lora_weights(main_lora_path, adapter_name="main") | ||
|
||
extra_lora_path = self.weights_cache.ensure(main_lora_url) |
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.
extra_lora_path = self.weights_cache.ensure(main_lora_url) | |
extra_lora_path = self.weights_cache.ensure(extra_lora_url) |
0ea52ad
to
0a7b049
Compare
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.
❌ Changes requested. Incremental review on 0a7b049 in 37 seconds
More details
- Looked at
910
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. weights.py:71
- Draft comment:
Thedownload_weights
function is defined twice, here and inpredict.py
. Consider removing the duplicate inpredict.py
to avoid redundancy. - Reason this comment was not posted:
Marked as duplicate.
2. weights.py:76
- Draft comment:
Thedownload_weights_url
function is not used anywhere in the code. Consider removing it if it's not needed. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is incorrect because thedownload_weights_url
function is used in thedownload_weights
function. Removing it would break the functionality of the code. The comment should be removed as it suggests an incorrect action.
I might be overlooking other potential uses of the function or misunderstand the flow of the code. However, the direct call withindownload_weights
is clear and indicates usage.
The direct call todownload_weights_url
withindownload_weights
confirms its usage, so the comment is indeed incorrect.
The comment should be removed because it incorrectly states that thedownload_weights_url
function is unused, while it is actually used in the code.
3. weights.py:92
- Draft comment:
Thedownload_safetensors_tarball
function is not used anywhere in the code. Consider removing it if it's not needed. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment suggests thatdownload_safetensors_tarball
is not used, but upon reviewing the code, it is clear that this function is called withindownload_weights_url
. Therefore, the comment is incorrect as the function is indeed used in the code.
I might be missing some context about whether the function is used in a meaningful way or if the logic is correct, but the fact remains that the function is called in the code.
The function is explicitly called in the code, which means it is used. The comment is incorrect in stating that it is not used.
The comment is incorrect becausedownload_safetensors_tarball
is used in the code. Therefore, the comment should be removed.
4. weights.py:72
- Draft comment:
Ensure that thedownload_weights
function inweights.py
is used consistently across the codebase to avoid redundancy and potential inconsistencies. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is speculative and doesn't point out a specific issue in the code. It suggests a general practice rather than addressing a concrete problem in the diff. According to the rules, comments should only be made if there's a definite issue or code change required.
I might be overlooking a potential inconsistency in the code that the comment is hinting at. However, without a specific example or evidence, the comment remains speculative.
The comment does not provide specific evidence of inconsistency, making it speculative. It doesn't align with the rules for actionable comments.
The comment should be removed as it is speculative and does not point out a specific issue or required code change.
Workflow ID: wflow_ksgnFUT0qdzBri14
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
predict.py
Outdated
return ASPECT_RATIOS[aspect_ratio] | ||
|
||
|
||
def download_weights(url, dest): |
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.
The download_weights
function is defined twice, here and in weights.py
. Consider removing this duplicate and using the one from weights.py
to avoid redundancy.
0a7b049
to
a2c2bb1
Compare
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.
❌ Changes requested. Incremental review on a2c2bb1 in 36 seconds
More details
- Looked at
918
lines of code in7
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. predict.py:316
- Draft comment:
Thedownload_weights
function is defined here and inweights.py
. Consider removing this duplicate definition and importing it fromweights.py
to avoid redundancy. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment suggests a code quality improvement by removing redundancy, which is generally a good practice. However, without seeing theweights.py
file in the diff, I cannot confirm if the function is indeed duplicated. The comment might be speculative if the duplication is not confirmed.
I might be missing the context ofweights.py
since it's not shown in the diff. The comment could be speculative if the duplication is not confirmed, which would violate the rules against speculative comments.
Even if the duplication is not confirmed, suggesting to remove redundancy is a valid code quality improvement. However, without confirmation, the comment might not be actionable.
The comment is speculative because it assumes a duplication without confirmation from the diff. It should be removed unless the duplication is confirmed.
2. weights.py:71
- Draft comment:
Thedownload_weights
function is defined here and inpredict.py
. Consider removing this duplicate definition and importing it frompredict.py
to avoid redundancy. - Reason this comment was not posted:
Marked as duplicate.
3. weights.py:97
- Draft comment:
Consider handling other potential exceptions that might occur during the subprocess execution indownload_safetensors_tarball
to make the function more robust. - Reason this comment was not posted:
Confidence changes required:50%
Thedownload_safetensors_tarball
function usessubprocess.run
without handling potential exceptions other thanCalledProcessError
. It's good practice to handle other exceptions that might occur during the subprocess execution.
4. weights.py:132
- Draft comment:
Consider handling other potential exceptions that might occur during the subprocess execution indownload_safetensors
to make the function more robust. - Reason this comment was not posted:
Confidence changes required:50%
Thedownload_safetensors
function usessubprocess.run
without handling potential exceptions other thanCalledProcessError
. It's good practice to handle other exceptions that might occur during the subprocess execution.
Workflow ID: wflow_gKXuZqxbZKH2Vgdi
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
predict.py
Outdated
main_lora_path = self.weights_cache.ensure(main_lora_url) | ||
pipe.load_lora_weights(main_lora_path, adapter_name="main") | ||
|
||
extra_lora_path = self.weights_cache.ensure(main_lora_url) |
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.
The extra_lora_path
should be derived from extra_lora_url
, not main_lora_url
. This will ensure the correct LoRA weights are loaded.
extra_lora_path = self.weights_cache.ensure(main_lora_url) | |
extra_lora_path = self.weights_cache.ensure(extra_lora_url) |
a2c2bb1
to
1eb6e49
Compare
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.
👍 Looks good to me! Incremental review on 1eb6e49 in 22 seconds
More details
- Looked at
932
lines of code in7
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. predict.py:42
- Draft comment:
The use of '|' for type hinting is only supported in Python 3.10 and later. Ensure compatibility if using older Python versions. - Reason this comment was not posted:
Confidence changes required:50%
The use of '|' for type hinting is only supported in Python 3.10 and later. Since the setup specifies Python 3.12, this is fine, but it's worth noting for compatibility.
2. predict.py:57
- Draft comment:
The functiondownload_weights
is defined inweights.py
but not used here. Ensure thatdownload_base_weights
is the intended function to use. - Reason this comment was not posted:
Confidence changes required:50%
Thedownload_weights
function is defined inweights.py
but is not used inpredict.py
. Instead,download_base_weights
is used. This might be intentional, but it's worth checking for consistency.
3. weights.py:71
- Draft comment:
Thedownload_weights
function is not used in the current code. Consider removing it if it's redundant. - Reason this comment was not posted:
Confidence changes required:50%
Thedownload_weights
function inweights.py
is not used anywhere in the current PR. It might be redundant ifdownload_base_weights
is intended to replace it.
4. weights.py:61
- Draft comment:
Remove the debug print statement for free disk space before merging. - Reason this comment was not posted:
Confidence changes required:50%
Theprint
statement for free disk space is marked as a TODO to remove. It should be removed before merging.
Workflow ID: wflow_QXiX2OkDQzpBQswx
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
1eb6e49
to
43ef925
Compare
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.
👍 Looks good to me! Incremental review on 43ef925 in 28 seconds
More details
- Looked at
932
lines of code in7
files - Skipped
0
files when reviewing. - Skipped posting
5
drafted comments based on config settings.
1. predict.py:42
- Draft comment:
Using '|' for type hinting is only supported in Python 3.10 and later. Ensure compatibility if earlier Python versions are needed. - Reason this comment was not posted:
Confidence changes required:50%
The use of '|' for type hinting is only supported in Python 3.10 and later. Since the CI is set up for Python 3.12, this is fine, but it's worth noting for compatibility with earlier versions.
2. weights.py:72
- Draft comment:
Consider adding exception handling formake_download_url
to handle cases where the URL parsing fails. - Reason this comment was not posted:
Confidence changes required:50%
Thedownload_weights
function inweights.py
is not handling exceptions for themake_download_url
function. Ifmake_download_url
raises an exception, it will not be caught, and the program will crash.
3. weights.py:99
- Draft comment:
Consider adding exception handling for the subprocess call topget
to handle download failures gracefully. - Reason this comment was not posted:
Confidence changes required:50%
Thedownload_weights_url
function inweights.py
does not handle exceptions for the subprocess call topget
. Ifpget
fails, it will raise an exception that is not caught.
4. weights.py:134
- Draft comment:
Consider adding exception handling for the subprocess call topget
to handle download failures gracefully. - Reason this comment was not posted:
Confidence changes required:50%
Thedownload_weights_url
function inweights.py
does not handle exceptions for the subprocess call topget
. Ifpget
fails, it will raise an exception that is not caught.
5. predict.py:320
- Draft comment:
Consider adding exception handling for the subprocess call topget
to handle download failures gracefully. - Reason this comment was not posted:
Confidence changes required:50%
Thedownload_weights_url
function inweights.py
does not handle exceptions for the subprocess call topget
. Ifpget
fails, it will raise an exception that is not caught.
Workflow ID: wflow_fLs6oJaRQjlJhzKP
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
43ef925
to
822dd1d
Compare
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.
👍 Looks good to me! Incremental review on 822dd1d in 32 seconds
More details
- Looked at
924
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
6
drafted comments based on config settings.
1. weights.py:89
- Draft comment:
The error message here is misleading fordata:
URLs. Consider updating it to reflect thatdata:
URLs are valid.
raise ValueError("URL must end with either .tar, .safetensors, or be a valid data URL")
- Reason this comment was not posted:
Confidence changes required:50%
The current implementation of thedownload_weights_url
function inweights.py
uses a series of conditional checks to determine the type of URL and the appropriate download method. However, the error message when the URL does not end with.tar
or.safetensors
is misleading because it doesn't account fordata:
URLs, which are handled separately. This could lead to confusion if a user provides a validdata:
URL but receives an error indicating an invalid file extension.
2. weights.py:99
- Draft comment:
Usingsubprocess.run
with URLs can be risky if the URL is not properly validated. Ensure that the URL is safe and expected before executing this command. - Reason this comment was not posted:
Confidence changes required:50%
Thedownload_safetensors_tarball
function inweights.py
usessubprocess.run
to download files, which can be a security risk if the URL is not properly validated. Although the URL is generated bymake_download_url
, it's still good practice to ensure that the URL is safe and expected before executing a command with it.
3. weights.py:109
- Draft comment:
Consider logging the contents of the tarball if the number of.safetensors
files is not exactly one. This can help with debugging if the tarball contents are unexpected. - Reason this comment was not posted:
Confidence changes required:33%
Thedownload_safetensors_tarball
function inweights.py
expects exactly one.safetensors
file in the tarball. If there are multiple or none, it raises aValueError
. This is a good check, but it might be helpful to log the contents of the tarball for debugging purposes if the check fails.
4. weights.py:126
- Draft comment:
Consider logging the contents of the extracted data if the number of.safetensors
files is not exactly one. This can help with debugging if the data contents are unexpected. - Reason this comment was not posted:
Confidence changes required:33%
Thedownload_data_url
function inweights.py
also expects exactly one.safetensors
file in the extracted data. Similar to thedownload_safetensors_tarball
function, it would be beneficial to log the contents of the extracted data for debugging if the check fails.
5. weights.py:134
- Draft comment:
Usingsubprocess.run
with URLs can be risky if the URL is not properly validated. Ensure that the URL is safe and expected before executing this command. - Reason this comment was not posted:
Confidence changes required:50%
Thedownload_safetensors
function inweights.py
usessubprocess.run
to download files, which can be a security risk if the URL is not properly validated. Although the URL is generated bymake_download_url
, it's still good practice to ensure that the URL is safe and expected before executing a command with it.
6. weights.py:140
- Draft comment:
Ensure that the regex patterns used here are comprehensive and account for all expected URL formats. Consider adding comments to explain each regex pattern for maintainability. - Reason this comment was not posted:
Confidence changes required:33%
Themake_download_url
function inweights.py
uses regular expressions to parse URLs. While this is generally fine, it's important to ensure that the regex patterns are comprehensive and account for all expected URL formats. Additionally, consider adding comments to explain each regex pattern for maintainability.
Workflow ID: wflow_Xd7fKaySsh0wTZ6O
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
822dd1d
to
0ce45b3
Compare
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.
👍 Looks good to me! Incremental review on 0ce45b3 in 31 seconds
More details
- Looked at
929
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
8
drafted comments based on config settings.
1. predict.py:42
- Draft comment:
Consider usingOptional[str]
fromtyping
for compatibility with Python versions earlier than 3.10.
main: Optional[str]
- Reason this comment was not posted:
Confidence changes required:33%
The use of '|' for type hinting is only supported in Python 3.10 and later. Since the CI is set up for Python 3.12, this is fine, but it's worth noting for compatibility with earlier versions.
2. predict.py:43
- Draft comment:
Consider usingOptional[str]
fromtyping
for compatibility with Python versions earlier than 3.10.
extra: Optional[str]
- Reason this comment was not posted:
Confidence changes required:33%
The use of '|' for type hinting is only supported in Python 3.10 and later. Since the CI is set up for Python 3.12, this is fine, but it's worth noting for compatibility with earlier versions.
3. predict.py:57
-
Draft comment:
Definedownload_base_weights
before using it in thesetup
method for better readability and to avoid potential issues. -
Reason this comment was not posted:
Confidence changes required:33%
Thedownload_base_weights
function is defined at the end of the file, but it's used here. It's better to define functions before they are used to improve code readability and avoid potential issues.
4. predict.py:65
-
Draft comment:
Definedownload_base_weights
before using it in thesetup
method for better readability and to avoid potential issues. -
Reason this comment was not posted:
Confidence changes required:33%
Thedownload_base_weights
function is defined at the end of the file, but it's used here. It's better to define functions before they are used to improve code readability and avoid potential issues.
5. predict.py:73
-
Draft comment:
Definedownload_base_weights
before using it in thesetup
method for better readability and to avoid potential issues. -
Reason this comment was not posted:
Confidence changes required:33%
Thedownload_base_weights
function is defined at the end of the file, but it's used here. It's better to define functions before they are used to improve code readability and avoid potential issues.
6. predict.py:316
- Draft comment:
Consider moving this function definition above its first usage in thesetup
method for better readability and to avoid potential issues. - Reason this comment was not posted:
Confidence changes required:33%
Thedownload_base_weights
function is defined at the end of the file, but it's used here. It's better to define functions before they are used to improve code readability and avoid potential issues.
7. weights.py:45
-
Draft comment:
Definedownload_weights
before using it in theWeightsDownloadCache
class for better readability and to avoid potential issues. -
Reason this comment was not posted:
Confidence changes required:33%
Thedownload_weights
function is used in theWeightsDownloadCache
class but is defined later. It's better to define functions before they are used to improve code readability and avoid potential issues.
8. weights.py:112
- Draft comment:
Consider moving this function definition above its first usage in theWeightsDownloadCache
class for better readability and to avoid potential issues. - Reason this comment was not posted:
Confidence changes required:33%
Thedownload_weights
function is used in theWeightsDownloadCache
class but is defined later. It's better to define functions before they are used to improve code readability and avoid potential issues.
Workflow ID: wflow_3aEGcNt543nftolA
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
0ce45b3
to
58adcfd
Compare
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.
❌ Changes requested. Incremental review on 58adcfd in 29 seconds
More details
- Looked at
938
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. weights.py:72
- Draft comment:
Ensure consistency by usingsubprocess.run
withcheck=True
instead ofsubprocess.check_call
in other parts of the codebase. - Reason this comment was not posted:
Confidence changes required:50%
Thedownload_weights
function inweights.py
usessubprocess.run
withcheck=True
, which is a better practice thansubprocess.check_call
. This should be consistent across the codebase.
2. weights.py:62
- Draft comment:
Remove or replace the debug print statement with proper logging.
# print(f"{free=}") # Debugging line, consider removing or using logging
- Reason this comment was not posted:
Confidence changes required:50%
Theprint
statement for debugging purposes should be removed or replaced with proper logging before merging to the main branch.
3. weights.py:55
- Draft comment:
Remove or replace the debug print statement with proper logging.
# print("removing oldest", oldest) # Debugging line, consider removing or using logging
- Reason this comment was not posted:
Confidence changes required:50%
Theprint
statement for debugging purposes should be removed or replaced with proper logging before merging to the main branch.
Workflow ID: wflow_pmNZr3IP1luOpX8S
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
start = time.time() | ||
print("downloading url: ", url) | ||
print("downloading to: ", dest) | ||
subprocess.check_call(["pget", "-xf", url, dest], close_fds=False) |
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.
Consider using subprocess.run
with check=True
instead of subprocess.check_call
for better error handling and security.
subprocess.check_call(["pget", "-xf", url, dest], close_fds=False) | |
subprocess.run(["pget", "-xf", url, dest], check=True) |
58adcfd
to
19e777d
Compare
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.
👍 Looks good to me! Incremental review on 19e777d in 31 seconds
More details
- Looked at
938
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
6
drafted comments based on config settings.
1. weights.py:55
- Draft comment:
Consider using thelogging
module instead ofprint
for better control over logging levels and outputs. - Reason this comment was not posted:
Confidence changes required:50%
The use ofprint
for logging is not ideal for production code. It would be better to use a logging library for better control over log levels and outputs.
2. weights.py:62
- Draft comment:
Consider using thelogging
module instead ofprint
for better control over logging levels and outputs. - Reason this comment was not posted:
Confidence changes required:50%
The use ofprint
for logging is not ideal for production code. It would be better to use a logging library for better control over log levels and outputs.
3. weights.py:80
- Draft comment:
Consider using thelogging
module instead ofprint
for better control over logging levels and outputs. - Reason this comment was not posted:
Confidence changes required:50%
The use ofprint
for logging is not ideal for production code. It would be better to use a logging library for better control over log levels and outputs.
4. weights.py:92
- Draft comment:
Consider using thelogging
module instead ofprint
for better control over logging levels and outputs. - Reason this comment was not posted:
Confidence changes required:50%
The use ofprint
for logging is not ideal for production code. It would be better to use a logging library for better control over log levels and outputs.
5. predict.py:201
- Draft comment:
Consider using thelogging
module instead ofprint
for better control over logging levels and outputs. - Reason this comment was not posted:
Confidence changes required:50%
The use ofprint
for logging is not ideal for production code. It would be better to use a logging library for better control over log levels and outputs.
6. predict.py:204
- Draft comment:
Consider using thelogging
module instead ofprint
for better control over logging levels and outputs. - Reason this comment was not posted:
Confidence changes required:50%
The use ofprint
for logging is not ideal for production code. It would be better to use a logging library for better control over log levels and outputs.
Workflow ID: wflow_rETcXfXjLVlo5pks
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
19e777d
to
96c4dba
Compare
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.
👍 Looks good to me! Incremental review on 96c4dba in 31 seconds
More details
- Looked at
941
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
5
drafted comments based on config settings.
1. predict.py:42
- Draft comment:
Using '|' for type hinting requires Python 3.10+. Ensure compatibility if using older Python versions. - Reason this comment was not posted:
Confidence changes required:33%
The use of '|' for type hinting is not compatible with Python versions below 3.10. Since the setup specifies Python 3.12, this is not an issue, but it's worth noting for compatibility.
2. predict.py:57
- Draft comment:
Consider usingdownload_weights
fromweights.py
for consistency, unlessdownload_base_weights
is intentionally different. - Reason this comment was not posted:
Confidence changes required:33%
Thedownload_weights
function is defined inweights.py
but is not used inpredict.py
. Instead,download_base_weights
is used. This might be intentional, but it's worth noting.
3. weights.py:72
- Draft comment:
Thedownload_weights
function is defined but not used. Consider removing it if it's not needed. - Reason this comment was not posted:
Confidence changes required:33%
Thedownload_weights
function inweights.py
is not used in the current code. It might be intended for future use or was replaced bydownload_base_weights
.
4. weights.py:62
- Draft comment:
Remove debug print statement to clean up the code. - Reason this comment was not posted:
Confidence changes required:33%
The debug print statement should be removed to clean up the code.
5. unit-tests/test_weights.py:112
- Draft comment:
Thedownload_weights
function is patched but not used in the tests. Consider removing the patch if it's not needed. - Reason this comment was not posted:
Confidence changes required:33%
Thedownload_weights
function is defined but not used in the tests. It might be intended for future use or was replaced by another function.
Workflow ID: wflow_F53r4r0La1hqpG8z
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
96c4dba
to
0e1b3f4
Compare
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.
👍 Looks good to me! Incremental review on 0e1b3f4 in 24 seconds
More details
- Looked at
939
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. weights.py:62
- Draft comment:
Remove the debug print statement or replace it with proper logging.
# print(f"{free=}") # Debugging line, consider removing or using logging
- Reason this comment was not posted:
Confidence changes required:50%
The current implementation of thedownload_weights_url
function inweights.py
uses aprint
statement for debugging purposes. This should be removed or replaced with proper logging to maintain clean code and avoid unnecessary console output in production.
2. weights.py:90
- Draft comment:
Consider handling URLs that start withdata:
as they are valid in this context.
raise ValueError("URL must end with either .tar, .safetensors, or start with data:")
- Reason this comment was not posted:
Confidence changes required:50%
Thedownload_weights_url
function inweights.py
raises aValueError
if the URL does not end with.tar
or.safetensors
. However, it should also handle URLs that start withdata:
as they are valid in this context.
3. predict.py:287
- Draft comment:
Clarify or remove the comment questioning if both LoRAs always need to be loaded.
# Ensure both LoRAs are loaded
- Reason this comment was not posted:
Confidence changes required:50%
Theload_multiple_loras
function inpredict.py
has a comment questioning if both LoRAs always need to be loaded. This should be clarified or removed if not necessary.
4. weights.py:73
- Draft comment:
Consider directly callingdownload_weights_url
with the correct URL format to reduce unnecessary function calls.
download_weights_url(make_download_url(url), path)
- Reason this comment was not posted:
Confidence changes required:50%
Thedownload_weights
function inweights.py
callsmake_download_url
and thendownload_weights_url
. It would be more efficient to directly calldownload_weights_url
with the correct URL format, reducing unnecessary function calls.
Workflow ID: wflow_5eXchGtBsnhRfKCb
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
0e1b3f4
to
bbb70ef
Compare
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.
👍 Looks good to me! Incremental review on bbb70ef in 21 seconds
More details
- Looked at
939
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. predict.py:42
- Draft comment:
Consider usingOptional[str]
from thetyping
module instead ofstr | None
for compatibility with Python versions below 3.10. - Reason this comment was not posted:
Confidence changes required:33%
The use of '|' for type hinting is not compatible with Python versions below 3.10. Since the CI is set up for Python 3.12, this is not an immediate issue, but it's worth noting for compatibility with older versions.
2. weights.py:45
- Draft comment:
Ensure that thedownload_weights
function is defined or imported in this file, as it is used in theWeightsDownloadCache
class. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is unnecessary because thedownload_weights
function is already defined in the file. The comment does not point out a code change requirement, as the function is present and correctly used. The comment violates the rule against asking the author to confirm or ensure something that is already evident in the code.
I might be overlooking the possibility that the comment is suggesting a different kind of issue, but the context strongly indicates it's about the presence of the function, which is already addressed.
The function is clearly defined in the file, so the comment is redundant. There is no indication of any other issue related todownload_weights
.
The comment should be removed because it incorrectly suggests a missing function definition that is already present in the file.
3. weights.py:62
- Draft comment:
Remove or replace the debug print statement with a proper logging mechanism. - Reason this comment was not posted:
Confidence changes required:50%
Theprint
statement for debugging should be removed or replaced with a proper logging mechanism before merging the code.
Workflow ID: wflow_2U2r1cM62K2UpH8k
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
bbb70ef
to
a890040
Compare
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.
❌ Changes requested. Incremental review on a890040 in 31 seconds
More details
- Looked at
978
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. predict.py:42
- Draft comment:
Using '|' for type hinting is only supported in Python 3.10 and later. Ensure compatibility if earlier Python versions are needed. - Reason this comment was not posted:
Confidence changes required:50%
The use of '|' for type hinting is only supported in Python 3.10 and later. Since the CI is set up for Python 3.12, this is fine, but it's worth noting for compatibility with earlier versions.
2. predict.py:57
- Draft comment:
download_base_weights
is used but not defined or imported. Ensure it's correctly imported or defined. - Reason this comment was not posted:
Marked as duplicate.
3. predict.py:65
- Draft comment:
download_base_weights
is used but not defined or imported before this line. Ensure it's correctly imported or defined earlier. - Reason this comment was not posted:
Marked as duplicate.
4. predict.py:73
- Draft comment:
download_base_weights
is used but not defined or imported before this line. Ensure it's correctly imported or defined earlier. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_6foEYhNhjwZ3K3Ya
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
a890040
to
4726442
Compare
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.
👍 Looks good to me! Incremental review on 4726442 in 24 seconds
More details
- Looked at
997
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. predict.py:320
- Draft comment:
Usingclose_fds=False
insubprocess.check_call
is not recommended. Consider removing it to prevent potential file descriptor leaks. - Reason this comment was not posted:
Confidence changes required:50%
The use ofsubprocess.check_call
withclose_fds=False
is not recommended as it can lead to file descriptor leaks. It's better to use the default behavior which isclose_fds=True
.
2. weights.py:116
- Draft comment:
Consider usingsubprocess.run
withcheck=True
instead ofsubprocess.check_call
for consistency and better error handling. - Reason this comment was not posted:
Confidence changes required:50%
Thedownload_weights
function inweights.py
usessubprocess.run
withcheck=True
, which is a better practice thansubprocess.check_call
. Thedownload_base_weights
function inpredict.py
should be updated to usesubprocess.run
for consistency and better error handling.
3. weights.py:78
- Draft comment:
The conversion ofpath
toPath
is redundant sincepath
is already aPath
object. Consider removing this line. - Reason this comment was not posted:
Confidence changes required:50%
Thedownload_weights_url
function inweights.py
has a redundant conversion ofpath
toPath
object since it's already aPath
object. This conversion can be removed.
4. weights.py:62
- Draft comment:
Remove or replace the debugprint
statement with proper logging before merging. - Reason this comment was not posted:
Confidence changes required:50%
Theprint
statement for debugging purposes should be removed or replaced with proper logging before merging the code.
Workflow ID: wflow_7KSyEzPYJSpOYrzM
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
4726442
to
26467de
Compare
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.
👍 Looks good to me! Incremental review on 26467de in 30 seconds
More details
- Looked at
966
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. predict.py:42
- Draft comment:
Using '|' for type hinting is only supported in Python 3.10 and above. Ensure compatibility if using older Python versions. - Reason this comment was not posted:
Confidence changes required:33%
The use of '|' for type hinting is not compatible with Python versions below 3.10. Since the setup specifies Python 3.12, this is not an issue for this project, but it's worth noting for compatibility with older versions.
2. weights.py:45
- Draft comment:
download_weights
is not defined. Did you meandownload_base_weights
? - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is incorrect becausedownload_weights
is indeed defined in the code. The suggestion to usedownload_base_weights
is not applicable as there is no such function in the code. The comment should be removed as it does not point out a real issue.
I might be missing some context about the intended functionality of the code, but based on the provided diff, the comment is clearly incorrect.
The code clearly definesdownload_weights
, so the comment is not valid in this context.
The comment is incorrect and should be removed becausedownload_weights
is defined in the code.
3. weights.py:62
- Draft comment:
Remove debug print statement or replace with proper logging. - Reason this comment was not posted:
Confidence changes required:50%
The debug print statement should be removed or replaced with proper logging before merging into the main branch.
4. unit-tests/test_weights.py:149
- Draft comment:
download_weights
is not defined. Did you meandownload_base_weights
? - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_Ic8AitP0FK3VSzCR
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
26467de
to
1e40d30
Compare
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.
👍 Looks good to me! Incremental review on 1e40d30 in 24 seconds
More details
- Looked at
966
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. predict.py:42
- Draft comment:
Using '|' for type hinting requires Python 3.10 or later. Ensure compatibility if using older Python versions. - Reason this comment was not posted:
Confidence changes required:33%
The use of '|' for type hinting is not compatible with Python versions below 3.10. Since the setup specifies Python 3.12, this is not an issue, but it's good to be aware of compatibility.
2. weights.py:62
- Draft comment:
Remove or replace the debug print statement for free disk space with proper logging if needed. - Reason this comment was not posted:
Confidence changes required:50%
The print statement for free disk space is marked as a TODO, indicating it might be left unintentionally. It should be removed or replaced with proper logging if needed.
3. weights.py:94
- Draft comment:
Ensure all expected URL formats are handled indownload_weights_url
to prevent unexpected errors. - Reason this comment was not posted:
Confidence changes required:50%
The functiondownload_weights_url
has a check for URL endings but does not handle all possible cases, which might lead to unexpected errors if a new URL format is introduced.
Workflow ID: wflow_iKMnnIjBJZAzxPiW
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
1e40d30
to
cf142a4
Compare
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.
👍 Looks good to me! Incremental review on cf142a4 in 34 seconds
More details
- Looked at
966
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
7
drafted comments based on config settings.
1. predict.py:42
- Draft comment:
Consider usingOptional[str]
fromtyping
for compatibility with Python versions earlier than 3.10.
main: Optional[str]
- Reason this comment was not posted:
Confidence changes required:33%
The use of '|' for type hinting is only supported in Python 3.10 and later. Since the CI is set up for Python 3.12, this is fine, but it's worth noting for compatibility with earlier versions.
2. predict.py:43
- Draft comment:
Consider usingOptional[str]
fromtyping
for compatibility with Python versions earlier than 3.10.
extra: Optional[str]
- Reason this comment was not posted:
Confidence changes required:33%
The use of '|' for type hinting is only supported in Python 3.10 and later. Since the CI is set up for Python 3.12, this is fine, but it's worth noting for compatibility with earlier versions.
3. predict.py:57
- Draft comment:
Consider moving thedownload_base_weights
function definition above its first usage for better readability. - Reason this comment was not posted:
Confidence changes required:33%
Thedownload_base_weights
function is defined at the end of the file, but it's used here. It's better to define functions before they are used to improve code readability.
4. predict.py:65
- Draft comment:
Consider moving thedownload_base_weights
function definition above its first usage for better readability. - Reason this comment was not posted:
Confidence changes required:33%
Thedownload_base_weights
function is defined at the end of the file, but it's used here. It's better to define functions before they are used to improve code readability.
5. predict.py:73
- Draft comment:
Consider moving thedownload_base_weights
function definition above its first usage for better readability. - Reason this comment was not posted:
Confidence changes required:33%
Thedownload_base_weights
function is defined at the end of the file, but it's used here. It's better to define functions before they are used to improve code readability.
6. predict.py:316
- Draft comment:
Consider moving this function definition above its first usage for better readability. - Reason this comment was not posted:
Confidence changes required:33%
Thedownload_base_weights
function is defined at the end of the file, but it's used here. It's better to define functions before they are used to improve code readability.
7. weights.py:73
- Draft comment:
Themake_download_url
function is well-tested intest_weights.py
, ensuring robustness in URL parsing and handling. - Reason this comment was not posted:
Confidence changes required:0%
Thedownload_weights
function inweights.py
usesmake_download_url
to determine the download URL. This function is well-tested intest_weights.py
, ensuring robustness.
Workflow ID: wflow_TpsiuR4r9uCPDf0a
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
cf142a4
to
9f073e6
Compare
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.
👍 Looks good to me! Incremental review on 9f073e6 in 27 seconds
More details
- Looked at
966
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. predict.py:42
- Draft comment:
Using '|' for type hinting requires Python 3.10 or newer. Ensure compatibility if using older Python versions. - Reason this comment was not posted:
Confidence changes required:33%
The use of '|' for type hinting is not compatible with Python versions below 3.10. Since the setup specifies Python 3.12, this is not an issue for this project, but it's worth noting for compatibility with older versions.
2. weights.py:45
- Draft comment:
download_weights
is not defined. Usedownload_base_weights
or the correct function name. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is incorrect becausedownload_weights
is defined in the code. The suggestion to usedownload_base_weights
or another function name is not supported by the code, as there is no such function defined or needed. The comment does not point out a real issue in the code.
I might be missing some context outside of the provided code, such as a larger codebase wheredownload_weights
might have been renamed. However, based on the provided diff, the comment is incorrect.
The diff provided is self-contained, and the functiondownload_weights
is clearly defined. Therefore, the comment is not applicable to this diff.
The comment is incorrect becausedownload_weights
is defined in the code. It should be removed as it does not point out a real issue.
3. weights.py:62
- Draft comment:
Remove debug print statement or replace with logging. - Reason this comment was not posted:
Confidence changes required:50%
The debug print statement should be removed or replaced with proper logging before production deployment.
4. unit-tests/test_weights.py:133
- Draft comment:
download_weights
is not defined. Usedownload_base_weights
or the correct function name. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_Xh8yrANluYjnmpWZ
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
9f073e6
to
f358b44
Compare
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.
👍 Looks good to me! Incremental review on f358b44 in 23 seconds
More details
- Looked at
966
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. predict.py:42
- Draft comment:
Consider usingOptional[str]
from thetyping
module instead ofstr | None
for compatibility with Python versions below 3.10. - Reason this comment was not posted:
Confidence changes required:33%
The use of '|' for type hinting is not compatible with Python versions below 3.10. Since the CI is set up for Python 3.12, this is not an immediate issue, but it's worth noting for compatibility with older versions.
2. predict.py:57
- Draft comment:
The functiondownload_base_weights
is used here but defined later in the file. Consider moving the function definition above its first usage for better readability. - Reason this comment was not posted:
Confidence changes required:33%
Thedownload_base_weights
function is defined at the end of the file but is used earlier in thesetup
method. This can lead to confusion if the function is not found immediately when reading the code.
3. weights.py:62
- Draft comment:
Remove or replace the debug print statement with proper logging before deploying to production. - Reason this comment was not posted:
Confidence changes required:33%
Theprint
statement for debugging disk space should be removed or replaced with proper logging before production deployment.
4. weights.py:94
- Draft comment:
Ensure that the URL validation indownload_weights_url
covers all expected cases to prevent unexpected errors. - Reason this comment was not posted:
Confidence changes required:33%
Thedownload_weights_url
function has a check for URL endings but does not handle all possible cases, which might lead to unexpected errors.
Workflow ID: wflow_WPK5xlABHyXVdt7x
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
f358b44
to
3c22799
Compare
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.
👍 Looks good to me! Incremental review on 3c22799 in 35 seconds
More details
- Looked at
974
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
6
drafted comments based on config settings.
1. predict.py:42
- Draft comment:
Consider usingOptional[str]
fromtyping
for type hinting instead ofstr | None
for compatibility with Python versions below 3.10. - Reason this comment was not posted:
Confidence changes required:33%
The use of '|' for type hinting is not compatible with Python versions below 3.10. Since the setup specifies Python 3.12, this is not an issue for this project, but it's worth noting for compatibility with older versions.
2. weights.py:72
- Draft comment:
Consider adding exception handling todownload_weights
to manage potential download failures gracefully. - Reason this comment was not posted:
Confidence changes required:50%
Thedownload_weights
function inweights.py
is not handling exceptions that might occur during the download process. This could lead to unhandled exceptions if the download fails.
3. weights.py:62
- Draft comment:
Remove the debug print statement or replace it with proper logging. - Reason this comment was not posted:
Confidence changes required:10%
Thedownload_weights_url
function inweights.py
has a debug print statement that should be removed or replaced with proper logging.
4. weights.py:94
- Draft comment:
Consider providing a more descriptive error message when raisingValueError
for unsupported URL formats. - Reason this comment was not posted:
Confidence changes required:20%
Thedownload_weights_url
function inweights.py
raises aValueError
if the URL does not end with.tar
or.safetensors
. This is a good check, but the error message could be more descriptive.
5. weights.py:127
- Draft comment:
Consider usingos.rename
instead ofshutil.move
if the source and destination are on the same filesystem for better performance. - Reason this comment was not posted:
Confidence changes required:20%
Thedownload_safetensors_tarball
function inweights.py
usesshutil.move
to move the safetensors file. This is fine, but it might be better to useos.rename
if the source and destination are on the same filesystem for better performance.
6. weights.py:148
- Draft comment:
Consider adding exception handling todownload_safetensors
to manage potential download failures gracefully. - Reason this comment was not posted:
Confidence changes required:50%
Thedownload_safetensors
function inweights.py
does not handle exceptions that might occur during the download process. This could lead to unhandled exceptions if the download fails.
Workflow ID: wflow_PfRj7IdPwrI4M7TJ
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
Supersedes #10
Summary:
This PR introduces multi-LoRA inference, refactors CI workflows, enhances weight management with caching, and adds unit tests, superseding PR #10.
Key points:
predict.py
withload_single_lora
andload_multiple_loras
.github/workflows/ci.yaml
to separate linting and unit testing.github/workflows/push.yaml
for safe push operations usingcog-safe-push
weights.py
usingWeightsDownloadCache
make_download_url
inweights.py
for URL parsing and downloadunit-tests/test_weights.py
for weight management and URL parsingrequirements-test.txt
for test dependenciesGenerated with ❤️ by ellipsis.dev