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

poetry unlock #430

Merged
merged 2 commits into from
Oct 19, 2024
Merged

poetry unlock #430

merged 2 commits into from
Oct 19, 2024

Conversation

michaelfeil
Copy link
Owner

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Oct 19, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 58.75000% with 33 lines in your changes missing coverage. Please review.

Project coverage is 79.27%. Comparing base (a41b1ec) to head (cf1d3a2).

Files with missing lines Patch % Lines
...emb/infinity_emb/transformer/quantization/quant.py 5.88% 16 Missing ⚠️
...nity_emb/infinity_emb/transformer/utils_optimum.py 0.00% 3 Missing ⚠️
libs/infinity_emb/infinity_emb/infinity_server.py 33.33% 2 Missing ⚠️
libs/infinity_emb/infinity_emb/telemetry.py 50.00% 2 Missing ⚠️
...mb/infinity_emb/transformer/vision/torch_vision.py 50.00% 2 Missing ⚠️
libs/infinity_emb/infinity_emb/primitives.py 50.00% 1 Missing ⚠️
libs/infinity_emb/infinity_emb/sync_engine.py 75.00% 1 Missing ⚠️
...finity_emb/infinity_emb/transformer/audio/torch.py 0.00% 1 Missing ⚠️
...finity_emb/infinity_emb/transformer/audio/utils.py 0.00% 1 Missing ⚠️
...b/infinity_emb/transformer/crossencoder/optimum.py 0.00% 1 Missing ⚠️
... and 3 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #430      +/-   ##
==========================================
+ Coverage   79.14%   79.27%   +0.12%     
==========================================
  Files          41       41              
  Lines        3246     3242       -4     
==========================================
+ Hits         2569     2570       +1     
+ Misses        677      672       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This pull request primarily focuses on updating the project's build system and code formatting:

  • Switched from 'black' to 'ruff' for linting and formatting in Makefiles
  • Updated dependencies in pyproject.toml, including infinity_emb to version 0.0.65
  • Improved code readability by removing unnecessary line breaks and simplifying expressions
  • Modified the base64 encoding process for embeddings in OpenAIEmbeddingResult class
  • Consolidated warning message about ct2 inference deprecation in transformer/embedder/ct2.py

28 file(s) reviewed, 26 comment(s)
Edit PR Review Bot Settings | Greptile

poetry run ruff .
[ "$(PYTHON_FILES)" = "" ] || poetry run black $(PYTHON_FILES) --check
poetry run ruff check .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: An empty line has been introduced here. Consider removing it to maintain consistent spacing in the Makefile.

@@ -32,13 +32,12 @@ lint format: PYTHON_FILES=.
lint_diff format_diff: PYTHON_FILES=$(shell git diff --relative=libs/infinity_emb --name-only --diff-filter=d master | grep -E '\.py$$|\.ipynb$$')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: This line uses 'libs/infinity_emb' in the path. Ensure this is the correct path, as the Makefile is in 'libs/embed_package'.

Comment on lines 32 to 34
PYTHON_FILES=.
lint format: PYTHON_FILES=.
lint: PYTHON_FILES=./infinity_emb
lint_diff format_diff: PYTHON_FILES=$(shell git diff --relative=libs/infinity_emb --name-only --diff-filter=d master | grep -E '\.py$$|\.ipynb$$')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: PYTHON_FILES variable is defined differently for various tasks, may lead to inconsistent file selection

Comment on lines 194 to +195
# return core_schema.no_info_after_validator_function(cls, handler(str))
return core_schema.no_info_after_validator_function(
cls.validate, core_schema.str_schema()
)
return core_schema.no_info_after_validator_function(cls.validate, core_schema.str_schema())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: The commented-out line and the new line are functionally equivalent. Consider removing the commented line to improve code clarity.

Comment on lines 204 to 205
else:
embeddings = [e.tolist() for e in embeddings]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: The else condition now always converts embeddings to lists, removing the previous check for numpy arrays. Ensure this doesn't cause issues with other embedding types.

@@ -31,9 +31,7 @@ async def resolve_audio(
#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: There's a commented line here (#). Consider removing it if it's not needed, or add a comment explaining its purpose if it's intentionally left for future use.

resolve_audio(audio, allowed_sampling_rate, session)
for audio in audio_urls
]
*[resolve_audio(audio, allowed_sampling_rate, session) for audio in audio_urls]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: This line has been compacted. Ensure that it doesn't exceed the project's line length limit, which could affect readability.

assert (
percentile > 50 and percentile <= 100
), "percentile should be between 50 and 100"
assert percentile > 50 and percentile <= 100, "percentile should be between 50 and 100"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Assertion simplified. Verify if this affects readability.

Comment on lines 114 to +118
if self.is_colipali:
self.model = torch.compile(self.model, dynamic=True)
else:
self.model.vision_model = torch.compile(
self.model.vision_model, dynamic=True
)
self.model.text_model = torch.compile(
self.model.text_model, dynamic=True
)
self.model.vision_model = torch.compile(self.model.vision_model, dynamic=True)
self.model.text_model = torch.compile(self.model.text_model, dynamic=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: The compilation of vision_model and text_model has been simplified to single-line statements. Ensure this doesn't affect readability or debugging.

embeddings = list(
next(image_embeds if is_img else text_embeds) for is_img in type_is_img
)
embeddings = list(next(image_embeds if is_img else text_embeds) for is_img in type_is_img)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: This list comprehension might be less readable than a for loop. Consider refactoring for clarity if it becomes complex.

@michaelfeil michaelfeil merged commit 0a80dff into main Oct 19, 2024
36 checks passed
@michaelfeil michaelfeil deleted the unlock-poetry branch October 19, 2024 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants