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

Bug: __get_embeddings Method to Handle Both List and Single String input #1420

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

python296
Copy link

@python296 python296 commented May 20, 2024

Description

This PR updates the __get_embeddings method to handle both a list of strings and a single string input. Previously, the method only supported a list of strings. With this update, the method checks the type of the texts parameter and processes it accordingly.

Added a type check for the texts parameter to differentiate between a list of strings and a single string.
If texts is a list, the method processes each string individually and returns the list of query vectors.
If texts is a single string, the method processes it and returns a single-element list containing the query vector.

Related Issues

Method __get_embeddings in qdrant DB.

Solution and Design

Test Plan

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Docs update

Checklist

  • My pull request is atomic and focuses on a single change.
  • I have read the contributing guide and my code conforms to the guidelines.
  • I have documented my changes clearly and comprehensively.
  • I have added the required tests.

python296 added 2 commits May 20, 2024 20:54
…Inputs

Description:
This PR updates the __get_embeddings method to handle both a list of strings and a single string input. Previously, the method only supported a list of strings. With this update, the method checks the type of the texts parameter and processes it accordingly.

filter was a local variable inside if condition, hence rest of the code was failing.

Changes:

Added a type check for the texts parameter to differentiate between a list of strings and a single string.
If texts is a list, the method processes each string individually and returns the list of query vectors.
If texts is a single string, the method processes it and returns a single-element list containing the query vector.
Update __get_embeddings Method to Handle Both List and Single String …
@CLAassistant
Copy link

CLAassistant commented May 20, 2024

CLA assistant check
All committers have signed the CLA.

@python296 python296 closed this May 20, 2024
@python296 python296 reopened this May 20, 2024
@python296 python296 changed the title Fix: __get_embeddings Method to Handle Both List and Single String input Bug: __get_embeddings Method to Handle Both List and Single String input May 21, 2024
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