Sponsored by
Vmake Labs Video Enhancer
-Vmake Labs Video Enhancer uses AI to improve video quality, restore details, reduce blur, and upscale videos to 8K.
SentenceTransformer based on Shuu12121/CodeModernBERT-Owl🦉
This model is a
sentence-transformers
model fine-tuned from
Shuu12121/CodeModernBERT-Owl
, which is a
ModernBERT model specifically designed for code, pre-trained from scratch by me
.
It is specifically designed for code search and efficiently calculates semantic similarity between code snippets and documentation.
One of the key features of this model is its
maximum sequence length of 2048 tokens
, which allows it to handle moderately long code snippets and documentation.
Despite being a relatively small model with about
150 million parameters
, it demonstrates remarkable performance in code search tasks.
Despite being a relatively small model with around
150M parameters
, this model achieved an impressive
76.89
on the
CodeSearchNet
benchmark, demonstrating its high performance in code search tasks.
Since this model is specialized for code search, it does not support other tasks, and thus evaluation scores for other tasks are not provided.
In the CodeSearchNet task, this model outperforms many well-known models, as shown in the comparison table below.
To install Sentence Transformers, run the following command:
Sentence Transformers をインストールするには、以下のコマンドを実行します。
pip install -U sentence-transformers
Model Loading and Inference / モデルのロードと推論
from sentence_transformers import SentenceTransformer
# Load the model / モデルをダウンロードしてロード
model = SentenceTransformer("Shuu12121/CodeSearch-ModernBERT-Owl")
# Example sentences for inference / 推論用の文リスト
sentences = [
'Encrypts the zip file',
'def freeze_encrypt(dest_dir, zip_filename, config, opt):\n \n pgp_keys = grok_keys(config)\n icefile_prefix = "aomi-%s" % \\\n os.path.basename(os.path.dirname(opt.secretfile))\n if opt.icefile_prefix:\n icefile_prefix = opt.icefile_prefix\n\n timestamp = time.strftime("%H%M%S-%m-%d-%Y",\n datetime.datetime.now().timetuple())\n ice_file = "%s/%s-%s.ice" % (dest_dir, icefile_prefix, timestamp)\n if not encrypt(zip_filename, ice_file, pgp_keys):\n raise aomi.exceptions.GPG("Unable to encrypt zipfile")\n\n return ice_file',
'def transform(self, sents):\n \n\n def convert(tokens):\n return torch.tensor([self.vocab.stoi[t] for t in tokens], dtype=torch.long)\n\n if self.vocab is None:\n raise Exception(\n "Must run .fit() for .fit_transform() before " "calling .transform()."\n )\n\n seqs = sorted([convert(s) for s in sents], key=lambda x: -len(x))\n X = torch.LongTensor(pad_sequence(seqs, batch_first=True))\n return X',
]
# Generate embeddings / 埋め込みベクトルの生成
embeddings = model.encode(sentences)
print(embeddings.shape) # Output: [3, 768]# Calculate similarity scores / 類似度スコアの計算
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape) # Output: [3, 3]
Library Versions / ライブラリバージョン
Python: 3.11.11
Sentence Transformers: 3.4.1
Transformers: 4.50.0
PyTorch: 2.6.0+cu124
Accelerate: 1.5.2
Datasets: 3.4.1
Tokenizers: 0.21.1
Citation / 引用情報
Sentence Transformers
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
MultipleNegativesRankingLoss
@misc{henderson2017efficient,
title={Efficient Natural Language Response Suggestion for Smart Reply},
author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
year={2017},
eprint={1705.00652},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
Runs of Shuu12121 CodeSearch-ModernBERT-Owl on huggingface.co
1
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
-4
30-day runs
More Information About CodeSearch-ModernBERT-Owl huggingface.co Model
More CodeSearch-ModernBERT-Owl license Visit here:
CodeSearch-ModernBERT-Owl huggingface.co is an AI model on huggingface.co that provides CodeSearch-ModernBERT-Owl's model effect (), which can be used instantly with this Shuu12121 CodeSearch-ModernBERT-Owl model. huggingface.co supports a free trial of the CodeSearch-ModernBERT-Owl model, and also provides paid use of the CodeSearch-ModernBERT-Owl. Support call CodeSearch-ModernBERT-Owl model through api, including Node.js, Python, http.
CodeSearch-ModernBERT-Owl huggingface.co is an online trial and call api platform, which integrates CodeSearch-ModernBERT-Owl's modeling effects, including api services, and provides a free online trial of CodeSearch-ModernBERT-Owl, you can try CodeSearch-ModernBERT-Owl online for free by clicking the link below.
Shuu12121 CodeSearch-ModernBERT-Owl online free url in huggingface.co:
CodeSearch-ModernBERT-Owl is an open source model from GitHub that offers a free installation service, and any user can find CodeSearch-ModernBERT-Owl on GitHub to install. At the same time, huggingface.co provides the effect of CodeSearch-ModernBERT-Owl install, users can directly use CodeSearch-ModernBERT-Owl installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
CodeSearch-ModernBERT-Owl install url in huggingface.co: