sentence-transformers How to use Shuu12121/CodeSearch-ModernBERT-Owl-v1 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("Shuu12121/CodeSearch-ModernBERT-Owl-v1")
sentences = [
"The list of databases\n\nGenerated from protobuf field <code>repeated .google.cloud.alloydb.v1.Database databases = 1;</code>\n@param array<\\Google\\Cloud\\AlloyDb\\V1\\Database>|\\Google\\Protobuf\\Internal\\RepeatedField $var\n@return $this",
"public function setDatabases($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\AlloyDb\\V1\\Database::class);\n $this->databases = $arr;\n\n return $this;\n }",
"public function toApiArray($row, $role = 'guest', $deep = true)\n {\n return $row;\n }",
"def adapter( type = :file, *args, &block )\n adapters.add(type, *args, &block)\n end"
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]