-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix: correct issue with handling float32 #4312
Conversation
@ogabrielluiz sure, will go through reference code and will do the changes |
@ogabrielluiz updated and merged the code. Can you please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now. Could you test it to make sure the changes are valid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ogabrielluiz - Its giving following error:
Error building Component: Float32Embeddings.init() got an unexpected keyword argument '_code'
Traceback (most recent call last):
File "/mnt/d/github/langflow/src/backend/base/langflow/custom/utils.py", line 395, in build_custom_component_template
has_template_config = hasattr(custom_component, "template_config")
File "/mnt/d/github/langflow/src/backend/base/langflow/custom/custom_component/custom_component.py", line 408, in template_config
self._template_config = self.build_template_config()
File "/mnt/d/github/langflow/src/backend/base/langflow/custom/custom_component/base_component.py", line 97, in build_template_config
component_instance = cc_class(_code=self._code)
TypeError: Float32Embeddings.init() got an unexpected keyword argument '_code'
I will refactor it, after that it is working. Please do a review and mark as reviewed. As, code is tested.
@ogabrielluiz - I have made some re-arranging of code. Then it has started working. I have done the commit. Also code is tested now: |
Error building Component Pinecone: Invalid type for variable '0'. Required value type is float and passed type was float64 at ['values'][0] Fixed the issue by forcing float32
Linit Recommendation Handled
Streamline the Float32Embeddings class by removing unnecessary parent linkage and consolidating the embedding logic, ensuring consistent float32 output for embeddings.
Co-Authored-By: Gabriel Luiz Freitas Almeida <[email protected]>
* Update pinecone.py Error building Component Pinecone: Invalid type for variable '0'. Required value type is float and passed type was float64 at ['values'][0] Fixed the issue by forcing float32 * [autofix.ci] apply automated fixes * Linit Recommendation Handled Linit Recommendation Handled * [autofix.ci] apply automated fixes * refactor: Simplify Float32Embeddings implementation Streamline the Float32Embeddings class by removing unnecessary parent linkage and consolidating the embedding logic, ensuring consistent float32 output for embeddings. * refactor: Re-arranging the code. Co-Authored-By: Gabriel Luiz Freitas Almeida <[email protected]> * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <[email protected]>
Error building Component Pinecone: Invalid type for variable '0'. Required value type is float and passed type was float64 at ['values'][0]
Fixed the issue by forcing float32