Commit Graph

532 Commits

Author SHA1 Message Date
n0x29a
40e5e96212 draft 2025-02-18 17:57:33 +01:00
Hossam Hagag
8d04b81782 chore: Remove redundant specific model path (#480) 2025-02-18 03:13:14 +02:00
Dmitrii Ogn
b389798d8e Migration of models to dataclasses (#474)
* Migration of models to dataclasses

* Model description file

* Test fix

* kw_only support

* Multitask embeddings test fix

* list_supported_models type fix

* Dim fix for sparsemodels

* Dim fix for sparsemodels

* Dim fix for sparsemodels (x2)

* Model management type fix

* Interface docstring fixes

* Mypy fixes

* Typing fix again

* Typing fix again

* Special cast to SparseModelDescription

* Special cast to SparseModelDescription

* Special cast to SparseModelDescription

* typing fix for colpali

* typing fix for colpali

* typing fix for colpali

* typing fix for colpali

* Let's try generic typing for ModelManagment

* wip: dataclass idea, small fixes (#475)

* wip: dataclass idea, small fixes

* fix: fix exception message in base model description

* remove custom model descriptions

* make license, description and size in gb mandatory in model description

* fix: introduce _list_supported_models which returns model description objects

* test: add test for list supported models

* fix: fix list supported models usage in tests

---------

Co-authored-by: George <george.panchuk@qdrant.tech>
2025-02-16 00:00:26 +01:00
George
6f43572373 fix: fix problem appeared in poetry 2.1.0 (#478) 2025-02-15 22:27:41 +01:00
George
de4ecb48c7 new: add late interaction multimodal to package init (#471) 2025-02-12 18:10:07 +01:00
George
b9d605138f new: add py.typed (#472) 2025-02-12 18:09:54 +01:00
Hossam Hagag
a931f143ef Fix ci (#468)
* fix: Fix ci

* fix: Fix ci

* fix: Fix ci

* fix: Fix ci by downgrading mkdocstrings
2025-02-06 20:54:21 +01:00
Hossam Hagag
105ff19035 new: Add mypy type checker (#470)
* new: Add mypy type checker

* fix: fix mypy command

* fix: fix indentation for mypy

* fix: do not install redundant optional groups cuz python3.13 does not support onnx

---------

Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
2025-02-06 20:46:43 +01:00
George
4599b933ca wip: type hints for colpali (#469)
* wip: type hints for colpali

* new: Add colpali type hints

* refactor: Remove redundant type ignore

* fix: address remaining mypy issues

---------

Co-authored-by: hh-space-invader <h.hagag.ali@gmail.com>
2025-02-06 20:28:10 +01:00
Hossam Hagag
0fa1596c3d new: Add missing type hints (#464)
* new: Add missing type hints

* refactor: Removed type ignore

* fix: fix mypy complaints

* fix: remove redundant type coercion, fix skip list type

* new: more precise type for sparse embedding inference, a small revert for parallel processor

---------

Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
2025-02-06 16:46:23 +01:00
George
2fe33c5a62 colpali v1.3 by AndrewOgn (#427)
* wip: design draft

* Operators fix

* Fix model inputs

* Import from fastembed.late_interaction_multimodal

* Fixed method misspelling

* Tests, which do not run in CI
Docstring improvements

* Fix tests

* Bump colpali to version v1.3

* Remove colpali v1.2

* Remove colpali v1.2 from tests

* partial fix of change requests:
descriptions
docs
black

* query_max_length

* black colpali

* Added comment for EMPTY_TEXT_PLACEHOLDER

* Review fixes

* Removed redundant VISUAL_PROMPT_PREFIX

* type fix + model info

* new: add specific model path to colpali

* fix: revert accidental renaming

* fix: remove max_length from encode_batch

* refactoring: remove redundant QUERY_MAX_LENGTH variable

* refactoring: remove redundant document marker token id

* fix: fix type hints, fix tests, handle single image path embed, rename model, update description

* license: add gemma to NOTICE

* fix: do not run colpali test in ci

* fix: fix colpali test

---------

Co-authored-by: d.rudenko <dmitrii.rudenko@qdrant.com>
2025-02-06 16:23:06 +01:00
Hossam Hagag
969ea29923 new: Added type stub (#458)
* new: Added type stub

* chore: Updated stubs

* chore: device_id type hint

* chore: add -> none to init without args

* new: Added workflow type check

* chore: Revert added type checkers
2025-02-06 11:24:45 +01:00
Hossam Hagag
a5b266e018 Image type hints (#457)
* chore: Added type hints

* new: Add type hints for parallel processor

* new: Add image type hints

* fix: NdArray -> NumpyArray

* fix: remove redundant property

* refactoring: remove redundant new lines

* refactoring: remove redundant new line

* fix: fix image input types

* fix: remove redundant import

* fix: remove mp subscriptions due to mac os issues

* chore: Update type hints

* chore: Added type gints for functional

* refactor

---------

Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
2025-02-06 11:24:19 +01:00
Hossam Hagag
877d963bd1 Rerank type hints (#459)
* chore: Update type hints

* remove redundant array creation, update type hints

---------

Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
2025-02-04 17:40:50 +01:00
Hossam Hagag
37a66d9e16 new: Add sparse type hints (#460)
* new: Add sparse type hints

* fix: ndarray -> numpyarray

---------

Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
2025-02-04 17:17:25 +01:00
Hossam Hagag
b08febbf93 Late interaction type hints (#461)
* chore: Add type hints

* new: Add late_interaction type hints

* fix: ndarray -> numpy array

---------

Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
2025-02-04 17:14:11 +01:00
Hossam Hagag
6dbdd6d171 chore: Added type hints (#454)
* chore: Added type hints

* fix: Fix generic type

* fix: Fix generic type

* new: Add type hints for parallel processor

* fix: Revert queue sub type as its not supported

* fix: Revert queue sub type as its not supported

* fix: Fixed type hints

* chore: Updated type hints

* fix: Update task id to be public

* chore: Updated type hints

* chore: Updated type hints

* fix: minor reverts in parallel processor and onnx text model
2025-02-04 17:06:05 +01:00
Dmitrii Ogn
f1a3a6d082 Update pillow (#455)
* Update pillow

* relaxation of pillow update
2025-01-30 17:05:09 +01:00
Hossam Hagag
993dcd5f68 chore: Add missing type hints in functions (#453)
* chore: Add missing type hints in functions

* add missing import, small type refactor

---------

Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
2025-01-29 12:08:20 +01:00
Hossam Hagag
73e1e5ecb9 chore: Add missing returns in defs (#451)
* chore: Add missing returns in defs

* remove return type from init

* remove incorrect ndarray specifier

---------

Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
2025-01-29 08:33:49 +01:00
Dmitrii Ogn
105d6cfb97 E5 pooling fix (#445)
* HF sources for all models

* Proper normalization for e5 models

* Rollback to origin/master

* Warning

* Tests fix

* Logging + model refactoring

* fix: refactor warnings, make e5-large non-normalized

* remove redundant code, update canonical values for e5

* align warning style

---------

Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
2025-01-28 23:14:43 +01:00
Hossam Hagag
bb815405aa chore: Add any to kwargs (#450)
* new: Add mypy and pyright deps

* chore: Add any to kwargs

* chore: Add any to args

* add missing kwargs

---------

Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
2025-01-28 22:49:37 +01:00
Dmitrii Ogn
314842121d Load from local dir (#443)
* HF sources for all models

* Specific_model_path model path support

* Fix hf download

* fix: rollback incorrect model replacement

* refactor: remove redundant type imports

* refactor: replace List with list

* fix: remove redundant param in late interaction text embedding

* Update fastembed/common/model_management.py

* fix: rollback post process onnx output

---------

Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
2025-01-28 12:46:16 +01:00
Hossam Hagag
c2f6fd1c90 Fix paraphrase minilm (#436)
* fix: Fix minilm paraphrase by adding it to pool models

* tests: Updated minilm paraphrase canonical vector

* chore: Added a warning message for updating the model

* chore: Added version where model will be removed
2025-01-27 23:27:47 +01:00
Hossam Hagag
b05877de93 new: Added jina embedding v3 (#428)
* new: Added jina embedding v3

* refactor: Changed dim to int value

* new: Updated notice

* new: Extended text embedding with query embed and passage embed

* fix: Fix lazy load in query and passage embed

* tests: Added test for multitask embeddings

* nit: Remove cache dir from tests

* tests: Updated tests

* improve: Improve task selection

* fix: Fix ci

* fix: Update fastembed/text/multitask_embedding.py

Co-authored-by: George <george.panchuk@qdrant.tech>

* Update fastembed/text/multitask_embedding.py

Co-authored-by: George <george.panchuk@qdrant.tech>

* fix: Pass task id using kwargs to parallel processor

* tests: Added test for task assignment

* prefer enums over ints

* tests: Added test for parallel

* improve: Updated model description

* fix: Fix ci

* fix: Fix ci

* refactor: Refactor query_embed and passage_embed

* tests: Added task propagation to parallel

* refactor: Set default task as retrieval passage

* chore: Update default task in tests

---------

Co-authored-by: George <george.panchuk@qdrant.tech>
2025-01-27 23:27:23 +01:00
Hossam Hagag
54f6cd9cbc Improve progress bar new (#440)
* improve: Improve progress bar

* fix: Fix error downloading when internet connection down

* new: Added file hash computation to track new versions

* refactor: Removed redundant hash check
fix: Fix ci

* new: Verify using hf_api

* new: Improve progress bar

* refactor new progress bar (#446)

* refactor

* chore: Remove redundant enable progress bar

---------

Co-authored-by: hh-space-invader <h.hagag.ali@gmail.com>

* refactor comments

---------

Co-authored-by: George <george.panchuk@qdrant.tech>
2025-01-27 22:34:39 +01:00
Hossam Hagag
ae37da3bd4 fix: Update nomic ai model (#441)
* fix: Updated nomic ai with mean pooling

* chore: Updated warning message

* nit

* fix: Fix ci
2025-01-27 11:25:04 +01:00
George Panchuk
fa11d0f0c7 bump version to 0.5.1 v0.5.1 2025-01-16 11:11:43 +01:00
George
50289c62ed new: move onnx dependency to dev (#439)
* new: move onnx dependency to dev

* update poetry install, add more groups in pyproject
2025-01-15 17:39:06 +01:00
Dmitrii Ogn
3c10b6625b V0.5.0 (#430)
* Bump version
2024-12-24 16:32:53 +00:00
Dmitrii Ogn
e89654d435 Hf sources (#429)
* HF sources for all models
2024-12-24 14:10:16 +00:00
Hossam Hagag
cec8d54502 new: Provide userwarning when specifying providers and cuda (#425)
* new: Provide userwarning when specifying providers and cuda

* Updated warning message
2024-12-24 12:37:58 +02:00
Hossam Hagag
55b985c1ad new: Added multi-gpu example (#422)
* new: Added multi-gpu example

* improve: Updated multi-gpu example

* improve: Updated fastembed multi gpu docs example
2024-12-17 13:09:34 +01:00
Dmitrii Ogn
c8b1a18cfc Cross encoders parallelism (#419)
* Merge master

* rerank_pairs interface + parallelism support

* remove test notebook

* Removed unused code

* New tests for cross encoders and new interface

* Importing Self fix. We will need it for mypy support in newer versions

* Removed Self typing

* Removed non-needed changes from text

* Isort + black

* wip: start reviewing (#420)

Co-authored-by: Dmitrii Ogn <dimitriy_rudenko@mail.ru>

* Test fix

* Update fastembed/rerank/cross_encoder/text_cross_encoder.py

Co-authored-by: George <george.panchuk@qdrant.tech>

* Update fastembed/rerank/cross_encoder/text_cross_encoder.py

Co-authored-by: George <george.panchuk@qdrant.tech>

* Update fastembed/rerank/cross_encoder/text_cross_encoder.py

Co-authored-by: George <george.panchuk@qdrant.tech>

* Update fastembed/rerank/cross_encoder/text_cross_encoder_base.py

Co-authored-by: George <george.panchuk@qdrant.tech>

* Test for parallel processing + bugfix of PosixPath passing

* Removed non-needed import and added docstring

* Typing fix + argument passing

* Test parametrization
Moved to selected models set to test

* Run base test on all models

* Typing fix + improvement of input_names check

* nit: fix post process, update docstring, update tokenize, remove redundant imports

---------

Co-authored-by: George <george.panchuk@qdrant.tech>
2024-12-16 21:59:34 +03:00
Hossam Hagag
3b5e4c8722 new: Added jina clip v1 (#408)
* WIP: Added jina clip text embedding

* WIP: Added preprocess for jina clip

* WIP: Added jina clip vision (not sure if it works yet)

* improve: Improved mean pooling if the output doesnt have seq length

* fix: Fixed jina clip text

* nit

* fix: Fixed jina clip image preprocessor

* fix: Fix type hints
new: added resize2square

* tests: Add jina clip vision test case

* nit

* refactor: Update fastembed/image/transform/operators.py

Co-authored-by: George <george.panchuk@qdrant.tech>

* fix: Fix indentation

* refactor: Refactored how we call padding for image

* fix: Fix pad to image when resized size larger than new square canvas

* refactor: minor refactor

* refactor: Refactor some functions in preprocess image

* fix: Fix to pad image with specified fill color

* refactor: Change resize to classmethod

* fix: Fix jina clip text v1

* fix: fix pad to square for some rectangular images (#421)

---------

Co-authored-by: George <george.panchuk@qdrant.tech>
2024-12-16 12:45:09 +02:00
George
516170cbaf new: add python 3.13 support (#404) 2024-12-11 19:18:54 +00:00
Hossam Hagag
0f79d3f9d8 feat: Added a toggle to disable stemmer in bm25 (#416)
* feat: Added a toggle to disable stemmer in bm25

* refactor: Refactored how to disable stemming in bm25

* refactor: Refactored the way of disabling stemmer in bm25

* new: Added english fallback if language = None

* tests: Added test case for disable stemmer

* fix: Fix language to be only string

* tests: Updated bm25 toggle stemmer tests

* refactor: fix stopwords type

* fix: fix param propagation in parallel embed in bm25

---------

Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
2024-12-10 21:12:12 +01:00
Hossam Hagag
2ef9c38b8b Tsk 409 support gte models (#415)
* new: Added support for gte base model

* tests: Added test cannonical vectors for gte model
2024-12-04 09:25:35 +02:00
Hossam Hagag
da30f934d8 fix: Fix colbert model shape mismatch (#413)
* fix: Fix colbert model shape mismatch

* refactor: Added the truncation after tokenizer init
2024-11-28 13:59:52 +02:00
Hossam Hagag
adfc03ed0d Improve models cache progressbar (#406)
* chore: Remove typing hints of Python less than 3.9

* chore: Removed optional from cache as it cannot be undefined

* improve: Turned off progress bar of huggingface models if cached
2024-11-21 12:47:46 +02:00
Hossam Hagag
e9dc3b1060 Support jina embeddings v2 models (#405)
* new: Added support for jinaai/jina-embeddings-v2-base-zh

* new: Added support for jinaai/jina-embeddings-v2-base-es
2024-11-19 14:54:51 +01:00
George
1343e55076 new: drop python 3.8 support, update type hints, ci (#403) 2024-11-15 15:54:19 +01:00
amietn
9841666bd5 Remove numpy<2 dependency (#362)
This causes an incompatibility with spaCy because no matching
versions of numpy can be found when using both libraries at once.

It looks like the tests pass again without the numpy<2 requirement
so there is no reason to keep this requirement anymore.
v0.4.2
2024-11-13 11:43:02 +01:00
Hossam Hagag
860e2ad691 Tsk 375 add jina rerankers (#379)
* feat: Added jina reranker models

* chore: Added jina reranker canonical score values

* chore: added rounding of the output for easier reproducability

* chore: Added jina reranker models in batch test

* chore: remove redundant np.round

* chore: test only <1gb files in local

* chore: Updated docs to add rerankers

* fix: recompute canonical values with fp16

* new: extend NOTICE with jina reranker v2

---------

Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
2024-11-13 10:48:45 +01:00
Hossam Hagag
d141e29784 Fix type hint (#392)
* fix: Fix return of onnx_embed

* fix: Fix type hint of start method in worker class

* fix: Fix not passing kwargs in _preprocess_onnx_input and tokenize as base class

* fix: Fix not passing kwargs in _preprocess_onnx_input as base class

* fix: change tokenize in simpleTokenizer to classmethod

* chore: Changed query argument to Iterable to match base class

* chore: changed mask token id and pad token id to be int

* review suggestions (#398)

---------

Co-authored-by: George <george.panchuk@qdrant.tech>
2024-11-13 10:32:46 +01:00
Hossam Hagag
7c935717d2 improve: Changed the way we are adding the query and document markers in colbert (#391)
* improve: Changed the way we are adding the query and document markers in colbert

* fix: Truncate the inout_ids and attention_mask when adding query and document markers to original input length

* fix: Fix broadcast issue

* chore: Remove redundant if condition

* nit

* refactor (#397)

---------

Co-authored-by: George <george.panchuk@qdrant.tech>
2024-11-13 10:23:26 +01:00
paulmartrencharpro
8413066f7b Add rerankers to the list of supported models (Supported_Models.ipynb) (#393)
* Add rerankers to the list of supported models (Supported_Models.ipynb)

* fix: update imports

---------

Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
2024-11-13 09:59:28 +01:00
George
faed7f1320 fix: fix model cleanup in tests (#400)
* fix: fix model cleanup in tests
2024-11-12 19:08:39 +01:00
George
5b895420b1 Update GitHub templates (#389)
* new: add PR template, decouple bug template with new model request

* new: add feature request, model request
2024-11-08 11:45:21 +01:00
George
e868bbaebc new: add reranker example to readme (#390)
* new: add reranker example to readme

* Update README.md

Co-authored-by: Anush  <anushshetty90@gmail.com>

* fix: compute the scores

---------

Co-authored-by: Anush <anushshetty90@gmail.com>
2024-11-07 17:31:13 +01:00