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

feat(model): Support siliconflow rerank models #2188

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

fangyinc
Copy link
Collaborator

Description

Additions to #2157

How Has This Been Tested?

  1. Using siliconflow rerank models in DB-GPT webserver
# .env
RERANK_MODEL=rerank_proxy_silicon_flow
rerank_proxy_silicon_flow_proxy_server_url=https://api.siliconflow.cn/v1/rerank
rerank_proxy_silicon_flow_proxy_api_key={your-siliconflow-api-key}
rerank_proxy_silicon_flow_proxy_backend=BAAI/bge-reranker-v2-m3
  1. Using SiliconFlowRerankEmbeddings
from dbgpt.rag.embedding import SiliconFlowRerankEmbeddings

embedding = SiliconFlowRerankEmbeddings(api_key='{your_api_key}')
res = embedding.predict("Apple", candidates=["苹果", "香蕉", "水果", "蔬菜"])
print(res)

You will see the following output:

[0.9953725, 0.00046734812, 0.0020992735, 1.7502925e-05]

Snapshots:

Include snapshots for easier review.

Checklist:

  • My code follows the style guidelines of this project
  • I have already rebased the commits and make the commit message conform to the project standard.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules

@github-actions github-actions bot added enhancement New feature or request model Module: model labels Dec 11, 2024
Copy link
Collaborator

@Aries-ckt Aries-ckt left a comment

Choose a reason for hiding this comment

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

r+

Copy link
Collaborator

@csunny csunny left a comment

Choose a reason for hiding this comment

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

Cool, r+

@csunny csunny merged commit abab4e3 into eosphoros-ai:main Dec 11, 2024
5 checks passed
@fangyinc fangyinc deleted the silicon-rererank branch December 12, 2024 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request model Module: model
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants