mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-14 07:07:34 +00:00
fake consistent embeddings cleanup (#14256)
delete code that could never be reached
This commit is contained in:
parent
e26906c1dc
commit
4fb72ff76f
@ -53,11 +53,6 @@ class ConsistentFakeEmbeddings(FakeEmbeddings):
|
|||||||
"""Return consistent embeddings for the text, if seen before, or a constant
|
"""Return consistent embeddings for the text, if seen before, or a constant
|
||||||
one if the text is unknown."""
|
one if the text is unknown."""
|
||||||
return self.embed_documents([text])[0]
|
return self.embed_documents([text])[0]
|
||||||
if text not in self.known_texts:
|
|
||||||
return [float(1.0)] * (self.dimensionality - 1) + [float(0.0)]
|
|
||||||
return [float(1.0)] * (self.dimensionality - 1) + [
|
|
||||||
float(self.known_texts.index(text))
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class AngularTwoDimensionalEmbeddings(Embeddings):
|
class AngularTwoDimensionalEmbeddings(Embeddings):
|
||||||
|
Loading…
Reference in New Issue
Block a user