[New Model]: Snowflake Arctic Embed (Family) (#16649)

This commit is contained in:
wang.yuqi
2025-04-18 08:11:57 -07:00
committed by GitHub
parent 686623c5e7
commit 3d3ab3689f
7 changed files with 312 additions and 26 deletions
+8
View File
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
from collections.abc import Sequence
from typing import NamedTuple
import torch
import torch.nn.functional as F
@@ -37,3 +38,10 @@ def matryoshka_fy(tensor, dimensions):
tensor = tensor[..., :dimensions]
tensor = F.normalize(tensor, p=2, dim=1)
return tensor
class EmbedModelInfo(NamedTuple):
name: str
is_matryoshka: bool
architecture: str = ""
enable_test: bool = True