-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
[Misc] Fix examples openai_pooling_client.py #24853
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3a163e9
+ pooling
noooop 9739a89
+ fix
noooop 0cbaaa7
fix
noooop 77a156c
+ README.md
noooop 1b71beb
fix
noooop bbf5d8b
fix
noooop e3ab036
fix
noooop e9649a0
fix
noooop 27f7e4a
Update examples/offline_inference/pooling/README.md
noooop 8626601
Update examples/online_serving/pooling/README.md
noooop 002c381
move openai_embedding_long_text out
noooop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Pooling models | ||
|
|
||
| ## Convert llm model to seq cls | ||
|
|
||
| ```bash | ||
| # for BAAI/bge-reranker-v2-gemma | ||
| # Caution: "Yes" and "yes" are two different tokens | ||
| python examples/offline_inference/pooling/convert_model_to_seq_cls.py --model_name BAAI/bge-reranker-v2-gemma --classifier_from_tokens '["Yes"]' --method no_post_processing --path ./bge-reranker-v2-gemma-seq-cls | ||
| # for mxbai-rerank-v2 | ||
| python examples/offline_inference/pooling/convert_model_to_seq_cls.py --model_name mixedbread-ai/mxbai-rerank-base-v2 --classifier_from_tokens '["0", "1"]' --method from_2_way_softmax --path ./mxbai-rerank-base-v2-seq-cls | ||
| # for Qwen3-Reranker | ||
| python examples/offline_inference/pooling/convert_model_to_seq_cls.py --model_name Qwen/Qwen3-Reranker-0.6B --classifier_from_tokens '["no", "yes"]' --method from_2_way_softmax --path ./Qwen3-Reranker-0.6B-seq-cls | ||
| ``` | ||
|
|
||
| ## Embed jina_embeddings_v3 usage | ||
|
|
||
| Only text matching task is supported for now. See <gh-pr:16120> | ||
|
|
||
| ```bash | ||
| python examples/offline_inference/pooling/embed_jina_embeddings_v3.py | ||
| ``` | ||
|
|
||
| ## Embed matryoshka dimensions usage | ||
|
|
||
| ```bash | ||
| python examples/offline_inference/pooling/embed_matryoshka_fy.py | ||
| ``` | ||
|
|
||
| ## Qwen3 reranker usage | ||
|
|
||
| ```bash | ||
| python qwen3_reranker.py | ||
| ``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Pooling models | ||
|
|
||
| ## Cohere rerank usage | ||
|
|
||
| ```bash | ||
| python examples/online_serving/pooling/cohere_rerank_client.py | ||
| ``` | ||
|
|
||
| ## Jinaai rerank usage | ||
|
|
||
| ```bash | ||
| python examples/online_serving/pooling/jinaai_rerank_client.py | ||
| ``` | ||
|
|
||
| ## Openai chat embedding for multimodal usage | ||
|
|
||
| ```bash | ||
| python examples/online_serving/pooling/openai_chat_embedding_client_for_multimodal.py | ||
| ``` | ||
|
|
||
| ## Openai classification usage | ||
|
|
||
| ```bash | ||
| python examples/online_serving/pooling/openai_classification_client.py | ||
| ``` | ||
|
|
||
| ## Openai embedding usage | ||
|
|
||
| ```bash | ||
| python examples/online_serving/pooling/openai_embedding_client.py | ||
| ``` | ||
|
|
||
| ## Openai embedding matryoshka dimensions usage | ||
|
|
||
| ```bash | ||
| python examples/online_serving/pooling/openai_embedding_matryoshka_fy.py | ||
| ``` | ||
|
|
||
| ## Openai pooling usage | ||
|
|
||
| ```bash | ||
| python examples/online_serving/pooling/openai_pooling_client.py | ||
| ``` |
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
...i_chat_embedding_client_for_multimodal.py → ...i_chat_embedding_client_for_multimodal.py
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
5 changes: 5 additions & 0 deletions
5
...e_serving/openai_classification_client.py → ...g/pooling/openai_classification_client.py
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
5 changes: 5 additions & 0 deletions
5
...online_serving/openai_embedding_client.py → ...erving/pooling/openai_embedding_client.py
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
File renamed without changes.
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
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.
Uh oh!
There was an error while loading. Please reload this page.