Skip to content

Changed the way embedding model creation is handled in the AbstractGraph class. #135

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 1 commit into from
May 3, 2024

Conversation

S4mpl3r
Copy link
Contributor

@S4mpl3r S4mpl3r commented May 3, 2024

Now instead of using self._create_llm() method for both embedding models and LLMs and delegating the correct instantiation of embedding models to the RAGNode class, there are two dedicated methods for creating embedding models and the logic is completely inside the AbstractGraph class:

  1. self.create_default_embedder(): This method handles the case where no embedding model is provided in the config. This will try to instantiate the proper embedding model based on the chosen LLM. Previously, this case was handled in the self.execute() method in the RAGNode class. I didn't change the code for this part (it's a copy-paste of the old code) so that it works just like it was previously.
  2. self.create_embedder(): This method handles the case where an embedding model is explicitly provided in the config. It checks for the embedding model's name in the config and instantiates the proper embedding model. Code-wise it looks similar to self._create_llm().

This pull request was created to address the issue that was discussed in #120

… class and removed handling of embedding model creation from RAGNode. Now AbstractGraph will call a dedicated method for embedding models instead of _create_llm. This makes it easy to use any LLM with any supported embedding model.
@VinciGit00 VinciGit00 merged commit 2abe05a into ScrapeGraphAI:pre/beta May 3, 2024
Copy link

github-actions bot commented May 3, 2024

🎉 This PR is included in version 0.7.0-beta.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

github-actions bot commented May 3, 2024

🎉 This PR is included in version 0.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants