mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-13 14:48:54 +02:00
Merge 25b23e0f86
into 138bb51997
This commit is contained in:
commit
f1b3792445
|
@ -44,10 +44,7 @@ private[hnsw] object JMapBasedIdEmbeddingMap {
|
|||
injection: Injection[T, Array[Byte]],
|
||||
numElements: Option[Int] = Option.empty
|
||||
): IdEmbeddingMap[T] = {
|
||||
val map = numElements match {
|
||||
case Some(elements) => new ConcurrentHashMap[T, EmbeddingVector](elements)
|
||||
case None => new ConcurrentHashMap[T, EmbeddingVector]()
|
||||
}
|
||||
val map = numElements.fold(new ConcurrentHashMap[T, EmbeddingVector])(elems => new ConcurrentHashMap(elems))
|
||||
HnswIOUtil.loadEmbeddings(
|
||||
embeddingFile,
|
||||
injection,
|
||||
|
|
Loading…
Reference in New Issue
Block a user