Skip to content

Commit

Permalink
Improved encode function
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Jul 9, 2024
1 parent f58345e commit 954777c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pgvector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Pgvector
autoload :PG, "pgvector/pg"

def self.encode(data)
if data.is_a?(SparseVector)
if data.is_a?(Vector) || data.is_a?(HalfVector) || data.is_a?(SparseVector)
data.to_s
else
Vector.new(data).to_s
Expand Down

0 comments on commit 954777c

Please sign in to comment.