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

Colipali - ready for review. #423

Merged
merged 15 commits into from
Oct 14, 2024
Merged

Colipali - ready for review. #423

merged 15 commits into from
Oct 14, 2024

Conversation

michaelfeil
Copy link
Owner

No description provided.

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 introduces significant changes to the Infinity Embedding Inference Server, focusing on expanding image processing capabilities and improving model handling.

  • Added support for new image collection models (ColPali, ColQwen2, ColIdefics2) in /libs/infinity_emb/infinity_emb/transformer/vision/__init__.py
  • Replaced ClipLikeModel with TorchImageModel in /libs/infinity_emb/infinity_emb/transformer/vision/torch_vision.py, adding support for Colipali models
  • Updated OpenAPI specification in /docs/assets/openapi.json to reflect changes in embedding object handling
  • Introduced 'colpali-engine' as a new optional dependency in /libs/infinity_emb/pyproject.toml
  • Modified test files to accommodate new image classification models and improve test coverage

16 file(s) reviewed, 27 comment(s)
Edit PR Review Bot Settings | Greptile

libs/client_infinity/run_generate_with_hook.sh Outdated Show resolved Hide resolved
libs/client_infinity/run_tests_with_hook.sh Show resolved Hide resolved
libs/infinity_emb/infinity_emb/__init__.py Show resolved Hide resolved
libs/infinity_emb/infinity_emb/__init__.py Show resolved Hide resolved
libs/infinity_emb/infinity_emb/__init__.py Show resolved Hide resolved
libs/infinity_emb/pyproject.toml Show resolved Hide resolved
Comment on lines 119 to 122
if __name__ == "__main__":
test_colpali("int8")
test_colpali("auto")
test_clip_like_model()
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider removing main block or using pytest.main()

@codecov-commenter
Copy link

codecov-commenter commented Oct 14, 2024

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

Codecov Report

Attention: Patch coverage is 87.03704% with 14 lines in your changes missing coverage. Please review.

Project coverage is 79.15%. Comparing base (0f1b786) to head (2cdf0c0).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...mb/infinity_emb/transformer/vision/torch_vision.py 88.23% 8 Missing ⚠️
libs/infinity_emb/infinity_emb/primitives.py 25.00% 3 Missing ⚠️
...ibs/infinity_emb/infinity_emb/transformer/utils.py 80.00% 2 Missing ⚠️
...inity_emb/infinity_emb/fastapi_schemas/pymodels.py 75.00% 1 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #423      +/-   ##
==========================================
+ Coverage   79.01%   79.15%   +0.14%     
==========================================
  Files          40       41       +1     
  Lines        3173     3228      +55     
==========================================
+ Hits         2507     2555      +48     
- Misses        666      673       +7     

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

Copy link
Owner Author

@michaelfeil michaelfeil left a comment

Choose a reason for hiding this comment

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

Ready for review. If you come across this PR, feel free to review.

@michaelfeil michaelfeil changed the title Colipali Colipali - ready for review. Oct 14, 2024
Copy link
Collaborator

@wirthual wirthual left a comment

Choose a reason for hiding this comment

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

Minor naming question.



class ClipLikeModel(BaseClipVisionModel):
class TorchImageModel(BaseClipVisionModel):
Copy link
Collaborator

Choose a reason for hiding this comment

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

For consistency, wouldn't make sense to also rename the base class here?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Resolved!

@michaelfeil michaelfeil merged commit faf5918 into main Oct 14, 2024
36 checks passed
@michaelfeil michaelfeil deleted the colipali branch October 14, 2024 15:43
@sir3mat
Copy link

sir3mat commented Oct 15, 2024

Are there any tutorials on how to expose Colpali as a microservice?

@michaelfeil
Copy link
Owner Author

michaelfeil commented Oct 15, 2024

No, but you can deploy it via docker.

i would suggest you to get started with

https://huggingface.co/michaelfeil/colpali-v12-random-testing (small one for testing the Api -enpoint)
https://huggingface.co/michaelfeil/colqwen2-v0.1 (for actual usage)

The following command after pip install and via docker works.

infinity_emb v2 —model-id michaelfeil/colpali-v12-random-testing 
# needs a 8GB+ GPU
infinity_emb v2 —model-id michaelfeil/colqwen2-v0.1 --batch-size 4

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.

4 participants