Skip to content

sentenceTransformar embedding model download locally to use #1361

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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

praveshkumar1988
Copy link
Collaborator

No description provided.

Copilot

This comment was marked as outdated.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements local downloading and caching of the sentence-transformers embedding model to improve performance and reduce dependency on external model downloads. The changes replace the previous approach of downloading models on each use with a local caching mechanism.

  • Implements a singleton pattern for embedding model initialization with thread-safe access
  • Adds local model downloading and caching functionality using a specified local path
  • Removes global embedding model initialization in favor of lazy loading where needed

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
backend/src/shared/common_fn.py Adds local model downloading, caching, and singleton pattern for embedding model access
backend/src/make_relationships.py Removes global embedding initialization and moves to lazy loading pattern
backend/src/QA_integration.py Removes global embedding initialization and adds lazy loading where needed
backend/requirements.txt Updates sentence-transformers version from 4.1.0 to 5.0.0
Comments suppressed due to low confidence (1)

backend/requirements.txt:56

  • The sentence-transformers version 5.0.0 does not exist. As of my knowledge cutoff in January 2025, the latest available version is in the 3.x series. Please verify the correct version number.
sentence-transformers==5.0.0

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