Sentence Similarity
sentence-transformers
Safetensors
bert
feature-extraction
Generated from Trainer
dataset_size:200000
loss:MatryoshkaLoss
loss:MultipleNegativesRankingLoss
Eval Results (legacy)
text-embeddings-inference
Instructions to use ArnavKewalram/bge-small-code-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use ArnavKewalram/bge-small-code-v1 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("ArnavKewalram/bge-small-code-v1") sentences = [ "Sets the global variables $rects and $origRectSpecs", "def modify_ranking(tournament):\n database = TinyDB('db.json')\n # recuperation de tous les joueurs du tournoi\n players_table = database.table('players')\n list_players = get_player_list(tournament)\n # Modification du rang joueur par joueur\n for player in list_players:\n new_ranking = view.modify_ranking_view(player)\n players_table.update({'Classement': new_ranking}, doc_ids=[player.doc_id])", "function setConstants() {\n const wrapItems = \".image-analysis-wrapper .face-wrap, .image-analysis-wrapper .score-wrap, .image-analysis-wrapper .attribute-wrap, .image-analysis-wrapper .region-block, .image-analysis-wrapper .region-block .word-block .word-wrap\";\n\n $rects = jQuery(\".image-analysis-wrapper .rectangle\");\n\n // Iterate over each rectangle and save the width, height, top position,\n // left position, closest stats block element, and position of the closest\n // stats block element to an object. Each object is then added to the \n // $origRectSpecs array for global use.\n $origRectSpecs = $rects.map(function () {\n closestWrapItems = jQuery(this).siblings(wrapItems);\n\n const stats = closestWrapItems.map(function () {\n return {\n origStatTop: jQuery(this).position().top || parseInt(jQuery(this).css(\"top\")),\n origStatLeft: jQuery(this).position().left || parseInt(jQuery(this).css(\"left\"))\n }\n })\n\n return {\n origRectWidth: jQuery(this).width(),\n origRectHeight: jQuery(this).height(),\n origRectTop: jQuery(this).position().top || parseInt(jQuery(this).css(\"top\")), // if the rect is on a tab that is currently not displayed it has a position of 0, so this check gets the css instead so we don't lose the value\n origRectLeft: jQuery(this).position().left || parseInt(jQuery(this).css(\"left\")),\n statBlock: closestWrapItems[0],\n statPosition: stats[0]\n }\n })\n }", "reset() {\n\n // Set the initial crop to match any given fixed aspect ratio (or\n // default to a square crop 1:1).\n let aspectRatio = this._initialAspectRatio\n\n // Calculate the initial crop size such that it fits within the bounds\n let width = getWidth(this.bounds)\n let height = getWidth(this.bounds) / aspectRatio\n\n if (aspectRatio < width / getHeight(this.bounds)) {\n width = getHeight(this.bounds) * aspectRatio\n height = getHeight(this.bounds)\n }\n\n // Calculate the initial crop position to be central to the bounds\n const x = (getWidth(this.bounds) - width) / 2\n const y = (getHeight(this.bounds) - height) / 2\n\n // Set the region\n this.region = [\n [x, y],\n [x + width, y + height]\n ]\n }" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Welcome to the community
The community tab is the place to discuss and collaborate with the HF community!