Shuu12121 commited on
Commit
18ab014
·
verified ·
1 Parent(s): 236ff7d

Upload ModernBERT model

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 512,
3
+ "pooling_mode_cls_token": true,
4
+ "pooling_mode_mean_tokens": false,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,559 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ - dense
7
+ - generated_from_trainer
8
+ - dataset_size:58800
9
+ - loss:MultipleNegativesRankingLoss
10
+ base_model: Shuu12121/CodeModernBERT-Finch
11
+ widget:
12
+ - source_sentence: 'Returns boolean indicating whether the requestUrl matches against
13
+ the paths configured.
14
+
15
+
16
+ @param requestedUrl - url requested by user
17
+
18
+ @param opts - unless configuration
19
+
20
+ @returns {boolean}'
21
+ sentences:
22
+ - "def xmoe2_v1_l4k_global_only():\n \"\"\"\"\"\"\n hparams = xmoe2_v1_l4k()\n\
23
+ \ hparams.decoder_layers = [\n \"att\" if l == \"local_att\" else l for\
24
+ \ l in hparams.decoder_layers]\n return hparams"
25
+ - "function matchesPath(requestedUrl, opts) {\n var paths = !opts.path || Array.isArray(opts.path)\
26
+ \ ?\n opts.path : [opts.path];\n\n if (paths) {\n return paths.some(function(p)\
27
+ \ {\n return (typeof p === 'string' && p === requestedUrl.pathname) ||\n\
28
+ \ (p instanceof RegExp && !! p.exec(requestedUrl.pathname));\n });\n\
29
+ \ }\n\n return false;\n}"
30
+ - "public static function factory($accessToken, $currentTeam)\n {\n $client\
31
+ \ = Client::factory($accessToken);\n\n return new self($client, $currentTeam);\n\
32
+ \ }"
33
+ - source_sentence: '// New creates a new ImageGraphics including an image.RGBA of
34
+ dimension w x h
35
+
36
+ // with background bgcol. If font is nil it will use a builtin font.
37
+
38
+ // If fontsize is empty useful default are used.'
39
+ sentences:
40
+ - "func New(width, height int, bgcol color.RGBA, font *truetype.Font, fontsize map[chart.FontSize]float64)\
41
+ \ *ImageGraphics {\n\timg := image.NewRGBA(image.Rect(0, 0, width, height))\n\t\
42
+ gc := draw2dimg.NewGraphicContext(img)\n\tgc.SetLineJoin(draw2d.BevelJoin)\n\t\
43
+ gc.SetLineCap(draw2d.SquareCap)\n\tgc.SetStrokeColor(image.Black)\n\tgc.SetFillColor(bgcol)\n\
44
+ \tgc.Translate(0.5, 0.5)\n\tgc.Clear()\n\tif font == nil {\n\t\tfont = defaultFont\n\
45
+ \t}\n\tif len(fontsize) == 0 {\n\t\tfontsize = ConstructFontSizes(13)\n\t}\n\t\
46
+ return &ImageGraphics{Image: img, x0: 0, y0: 0, w: width, h: height,\n\t\tbg:\
47
+ \ bgcol, gc: gc, font: font, fs: fontsize}\n}"
48
+ - "public static void requestDataLogsForApp(final Context context, final UUID appUuid)\
49
+ \ {\n final Intent requestIntent = new Intent(INTENT_DL_REQUEST_DATA);\n\
50
+ \ requestIntent.putExtra(APP_UUID, appUuid);\n context.sendBroadcast(requestIntent);\n\
51
+ \ }"
52
+ - "final protected function setWriteMode($mode)\n {\n if (!in_array($mode,\
53
+ \ [static::WRITE_MODE_INSERT, static::WRITE_MODE_UPSERT, static::WRITE_MODE_UPDATE]))\
54
+ \ {\n throw new \\InvalidArgumentException(sprintf('Passed write mode\
55
+ \ \"%s\" is invalid!', $mode));\n }\n $this->writeMode = $mode;\n\
56
+ \ }"
57
+ - source_sentence: 'Builds the path for a closed arc, returning a PolygonOptions that
58
+ can be
59
+
60
+ further customised before use.
61
+
62
+
63
+ @param center
64
+
65
+ @param start
66
+
67
+ @param end
68
+
69
+ @param arcType Pass in either ArcType.CHORD or ArcType.ROUND
70
+
71
+ @return PolygonOptions with the paths element populated.'
72
+ sentences:
73
+ - "function getJavaScriptCallbackParameterListSimple(parameters) {\n var result\
74
+ \ = []\n\n parameters.forEach(function(parameter){\n if (!parameter.out)\
75
+ \ return\n result.push(\"/*\" + getIdlType(parameter.type) + \"*/ \"+ parameter.name)\n\
76
+ \ })\n\n return result.join(\", \")\n}"
77
+ - "public Color getBackground() {\r\n\t\tpredraw();\r\n\t\tFloatBuffer buffer =\
78
+ \ BufferUtils.createFloatBuffer(16);\r\n\t\tGL.glGetFloat(SGL.GL_COLOR_CLEAR_VALUE,\
79
+ \ buffer);\r\n\t\tpostdraw();\r\n\r\n\t\treturn new Color(buffer);\r\n\t}"
80
+ - "public static final PolygonOptions buildClosedArc(LatLong center, LatLong start,\
81
+ \ LatLong end, ArcType arcType) {\n MVCArray res = buildArcPoints(center,\
82
+ \ start, end);\n if (ArcType.ROUND.equals(arcType)) {\n res.push(center);\n\
83
+ \ }\n return new PolygonOptions().paths(res);\n }"
84
+ - source_sentence: "Read data from a spread sheet. Return the data in a dict with\n\
85
+ \ column numbers as keys.\n\n sheet: xlrd.sheet.Sheet instance\n \
86
+ \ Ready for use.\n\n startstops: list\n Four StartStop objects defining\
87
+ \ the data to read. See\n :func:`~channelpack.pullxl.prepread`.\n\n \
88
+ \ usecols: str or seqence of ints or None\n The columns to use, 0-based.\
89
+ \ 0 is the spread sheet column\n \"A\". Can be given as a string also -\
90
+ \ 'C:E, H' for columns C, D,\n E and H.\n\n Values in the returned dict\
91
+ \ are numpy arrays. Types are set based on\n the types in the spread sheet."
92
+ sentences:
93
+ - "public function handleScanNotify(callable $callback)\n {\n $notify\
94
+ \ = $this->getNotify();\n\n if (!$notify->isValid()) {\n throw\
95
+ \ new FaultException('Invalid request payloads.', 400);\n }\n\n \
96
+ \ $notify = $notify->getNotify();\n\n try {\n $prepayId = call_user_func_array($callback,\
97
+ \ [$notify->get('product_id'), $notify->get('openid'), $notify]);\n \
98
+ \ $response = [\n 'return_code' => 'SUCCESS',\n \
99
+ \ 'appid' => $this->merchant->app_id,\n 'mch_id' =>\
100
+ \ $this->merchant->merchant_id,\n 'nonce_str' => uniqid(),\n\
101
+ \ 'prepay_id' => strval($prepayId),\n 'result_code'\
102
+ \ => 'SUCCESS',\n ];\n $response['sign'] = generate_sign($response,\
103
+ \ $this->merchant->key);\n } catch (\\Exception $e) {\n $response\
104
+ \ = [\n 'return_code' => 'SUCCESS',\n 'return_msg'\
105
+ \ => $e->getCode(),\n 'result_code' => 'FAIL',\n \
106
+ \ 'err_code_des' => $e->getMessage(),\n ];\n }\n\n \
107
+ \ return new Response(XML::build($response));\n }"
108
+ - "def _sheet_asdict(sheet, startstops, usecols=None):\n \"\"\"\n \"\"\"\n\
109
+ \n _, _, start, stop = startstops\n usecols = _sanitize_usecols(usecols)\n\
110
+ \n if usecols is not None:\n iswithin = start.col <= min(usecols) and\
111
+ \ stop.col > max(usecols)\n mess = 'Column in usecols outside defined data\
112
+ \ range, got '\n assert iswithin, mess + str(usecols)\n else: \
113
+ \ # usecols is None.\n usecols = tuple(range(start.col,\
114
+ \ stop.col))\n\n # cols = usecols or range(start.col, stop.col)\n D = dict()\n\
115
+ \n for c in usecols:\n cells = sheet.col(c, start_rowx=start.row, end_rowx=stop.row)\n\
116
+ \ types = set([cell.ctype for cell in cells])\n\n # Replace empty\
117
+ \ values with nan if appropriate:\n if (not types - NANABLE) and xlrd.XL_CELL_NUMBER\
118
+ \ in types:\n D[c] = np.array([np.nan if cell.value == '' else cell.value\n\
119
+ \ for cell in cells])\n elif xlrd.XL_CELL_DATE\
120
+ \ in types:\n dm = sheet.book.datemode\n vals = []\n \
121
+ \ for cell in cells:\n if cell.ctype == xlrd.XL_CELL_DATE:\n\
122
+ \ dtuple = xlrd.xldate_as_tuple(cell.value, dm)\n \
123
+ \ vals.append(datetime.datetime(*dtuple))\n elif cell.ctype\
124
+ \ in NONABLES:\n vals.append(None)\n else:\n\
125
+ \ vals.append(cell.value)\n D[c] = np.array(vals)\n\
126
+ \ else:\n vals = [None if cell.ctype in NONABLES else cell.value\n\
127
+ \ for cell in cells]\n D[c] = np.array(vals)\n\n\
128
+ \ return D"
129
+ - "func (o Option) RequiresOption(name string) bool {\n\tfor _, o := range o.Requires\
130
+ \ {\n\t\tif o == name {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}"
131
+ - source_sentence: '// reBuild partially rebuilds a site given the filesystem events.
132
+
133
+ // It returns whetever the content source was changed.
134
+
135
+ // TODO(bep) clean up/rewrite this method.'
136
+ sentences:
137
+ - "func WebPageImageResolver(doc *goquery.Document) ([]candidate, int) {\n\timgs\
138
+ \ := doc.Find(\"img\")\n\n\tvar candidates []candidate\n\tsignificantSurface :=\
139
+ \ 320 * 200\n\tsignificantSurfaceCount := 0\n\tsrc := \"\"\n\timgs.Each(func(i\
140
+ \ int, tag *goquery.Selection) {\n\t\tvar surface int\n\t\tsrc = getImageSrc(tag)\n\
141
+ \t\tif src == \"\" {\n\t\t\treturn\n\t\t}\n\n\t\twidth, _ := tag.Attr(\"width\"\
142
+ )\n\t\theight, _ := tag.Attr(\"height\")\n\t\tif width != \"\" {\n\t\t\tw, _ :=\
143
+ \ strconv.Atoi(width)\n\t\t\tif height != \"\" {\n\t\t\t\th, _ := strconv.Atoi(height)\n\
144
+ \t\t\t\tsurface = w * h\n\t\t\t} else {\n\t\t\t\tsurface = w\n\t\t\t}\n\t\t} else\
145
+ \ {\n\t\t\tif height != \"\" {\n\t\t\t\tsurface, _ = strconv.Atoi(height)\n\t\t\
146
+ \t} else {\n\t\t\t\tsurface = 0\n\t\t\t}\n\t\t}\n\n\t\tif surface > significantSurface\
147
+ \ {\n\t\t\tsignificantSurfaceCount++\n\t\t}\n\n\t\ttagscore := score(tag)\n\t\t\
148
+ if tagscore >= 0 {\n\t\t\tc := candidate{\n\t\t\t\turl: src,\n\t\t\t\tsurface:\
149
+ \ surface,\n\t\t\t\tscore: score(tag),\n\t\t\t}\n\t\t\tcandidates = append(candidates,\
150
+ \ c)\n\t\t}\n\t})\n\n\tif len(candidates) == 0 {\n\t\treturn nil, 0\n\t}\n\n\t\
151
+ return candidates, significantSurfaceCount\n\n}"
152
+ - "@SuppressWarnings(\"rawtypes\")\n\tpublic void open(Map conf, TopologyContext\
153
+ \ context,\n\t\t\tSpoutOutputCollector collector) {\n\t\tif(this.jmsProvider ==\
154
+ \ null){\n\t\t\tthrow new IllegalStateException(\"JMS provider has not been set.\"\
155
+ );\n\t\t}\n\t\tif(this.tupleProducer == null){\n\t\t\tthrow new IllegalStateException(\"\
156
+ JMS Tuple Producer has not been set.\");\n\t\t}\n\t\tInteger topologyTimeout =\
157
+ \ (Integer)conf.get(\"topology.message.timeout.secs\");\n\t\t// TODO fine a way\
158
+ \ to get the default timeout from storm, so we're not hard-coding to 30 seconds\
159
+ \ (it could change)\n\t\ttopologyTimeout = topologyTimeout == null ? 30 : topologyTimeout;\n\
160
+ \t\tif( (topologyTimeout.intValue() * 1000 )> this.recoveryPeriod){\n\t\t LOG.warn(\"\
161
+ *** WARNING *** : \" +\n\t\t \t\t\"Recovery period (\"+ this.recoveryPeriod\
162
+ \ + \" ms.) is less then the configured \" +\n\t\t \t\t\"'topology.message.timeout.secs'\
163
+ \ of \" + topologyTimeout + \n\t\t \t\t\" secs. This could lead to a message\
164
+ \ replay flood!\");\n\t\t}\n\t\tthis.queue = new LinkedBlockingQueue<Message>();\n\
165
+ \t\tthis.toCommit = new TreeSet<JmsMessageID>();\n this.pendingMessages\
166
+ \ = new HashMap<JmsMessageID, Message>();\n\t\tthis.collector = collector;\n\t\
167
+ \ttry {\n\t\t\tConnectionFactory cf = this.jmsProvider.connectionFactory();\n\t\
168
+ \t\tDestination dest = this.jmsProvider.destination();\n\t\t\tthis.connection\
169
+ \ = cf.createConnection();\n\t\t\tthis.session = connection.createSession(false,\n\
170
+ \t\t\t\t\tthis.jmsAcknowledgeMode);\n\t\t\tMessageConsumer consumer = session.createConsumer(dest);\n\
171
+ \t\t\tconsumer.setMessageListener(this);\n\t\t\tthis.connection.start();\n\t\t\
172
+ \tif (this.isDurableSubscription() && this.recoveryPeriod > 0){\n\t\t\t this.recoveryTimer\
173
+ \ = new Timer();\n\t\t\t this.recoveryTimer.scheduleAtFixedRate(new RecoveryTask(),\
174
+ \ 10, this.recoveryPeriod);\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\
175
+ \tLOG.warn(\"Error creating JMS connection.\", e);\n\t\t}\n\n\t}"
176
+ - "func (s *Site) processPartial(events []fsnotify.Event) (whatChanged, error) {\n\
177
+ \n\tevents = s.filterFileEvents(events)\n\tevents = s.translateFileEvents(events)\n\
178
+ \n\ts.Log.DEBUG.Printf(\"Rebuild for events %q\", events)\n\n\th := s.h\n\n\t\
179
+ // First we need to determine what changed\n\n\tvar (\n\t\tsourceChanged \
180
+ \ = []fsnotify.Event{}\n\t\tsourceReallyChanged = []fsnotify.Event{}\n\t\tcontentFilesChanged\
181
+ \ []string\n\t\ttmplChanged = []fsnotify.Event{}\n\t\tdataChanged \
182
+ \ = []fsnotify.Event{}\n\t\ti18nChanged = []fsnotify.Event{}\n\t\t\
183
+ shortcodesChanged = make(map[string]bool)\n\t\tsourceFilesChanged = make(map[string]bool)\n\
184
+ \n\t\t// prevent spamming the log on changes\n\t\tlogger = helpers.NewDistinctFeedbackLogger()\n\
185
+ \t)\n\n\tcachePartitions := make([]string, len(events))\n\n\tfor i, ev := range\
186
+ \ events {\n\t\tcachePartitions[i] = resources.ResourceKeyPartition(ev.Name)\n\
187
+ \n\t\tif s.isContentDirEvent(ev) {\n\t\t\tlogger.Println(\"Source changed\", ev)\n\
188
+ \t\t\tsourceChanged = append(sourceChanged, ev)\n\t\t}\n\t\tif s.isLayoutDirEvent(ev)\
189
+ \ {\n\t\t\tlogger.Println(\"Template changed\", ev)\n\t\t\ttmplChanged = append(tmplChanged,\
190
+ \ ev)\n\n\t\t\tif strings.Contains(ev.Name, \"shortcodes\") {\n\t\t\t\tshortcode\
191
+ \ := filepath.Base(ev.Name)\n\t\t\t\tshortcode = strings.TrimSuffix(shortcode,\
192
+ \ filepath.Ext(shortcode))\n\t\t\t\tshortcodesChanged[shortcode] = true\n\t\t\t\
193
+ }\n\t\t}\n\t\tif s.isDataDirEvent(ev) {\n\t\t\tlogger.Println(\"Data changed\"\
194
+ , ev)\n\t\t\tdataChanged = append(dataChanged, ev)\n\t\t}\n\t\tif s.isI18nEvent(ev)\
195
+ \ {\n\t\t\tlogger.Println(\"i18n changed\", ev)\n\t\t\ti18nChanged = append(dataChanged,\
196
+ \ ev)\n\t\t}\n\t}\n\n\t// These in memory resource caches will be rebuilt on demand.\n\
197
+ \tfor _, s := range s.h.Sites {\n\t\ts.ResourceSpec.ResourceCache.DeletePartitions(cachePartitions...)\n\
198
+ \t}\n\n\tif len(tmplChanged) > 0 || len(i18nChanged) > 0 {\n\t\tsites := s.h.Sites\n\
199
+ \t\tfirst := sites[0]\n\n\t\ts.h.init.Reset()\n\n\t\t// TOD(bep) globals clean\n\
200
+ \t\tif err := first.Deps.LoadResources(); err != nil {\n\t\t\treturn whatChanged{},\
201
+ \ err\n\t\t}\n\n\t\tfor i := 1; i < len(sites); i++ {\n\t\t\tsite := sites[i]\n\
202
+ \t\t\tvar err error\n\t\t\tdepsCfg := deps.DepsCfg{\n\t\t\t\tLanguage: site.language,\n\
203
+ \t\t\t\tMediaTypes: site.mediaTypesConfig,\n\t\t\t\tOutputFormats: site.outputFormatsConfig,\n\
204
+ \t\t\t}\n\t\t\tsite.Deps, err = first.Deps.ForLanguage(depsCfg, func(d *deps.Deps)\
205
+ \ error {\n\t\t\t\td.Site = &site.Info\n\t\t\t\treturn nil\n\t\t\t})\n\t\t\tif\
206
+ \ err != nil {\n\t\t\t\treturn whatChanged{}, err\n\t\t\t}\n\t\t}\n\t}\n\n\tif\
207
+ \ len(dataChanged) > 0 {\n\t\ts.h.init.data.Reset()\n\t}\n\n\tfor _, ev := range\
208
+ \ sourceChanged {\n\t\tremoved := false\n\n\t\tif ev.Op&fsnotify.Remove == fsnotify.Remove\
209
+ \ {\n\t\t\tremoved = true\n\t\t}\n\n\t\t// Some editors (Vim) sometimes issue\
210
+ \ only a Rename operation when writing an existing file\n\t\t// Sometimes a rename\
211
+ \ operation means that file has been renamed other times it means\n\t\t// it's\
212
+ \ been updated\n\t\tif ev.Op&fsnotify.Rename == fsnotify.Rename {\n\t\t\t// If\
213
+ \ the file is still on disk, it's only been updated, if it's not, it's been moved\n\
214
+ \t\t\tif ex, err := afero.Exists(s.Fs.Source, ev.Name); !ex || err != nil {\n\t\
215
+ \t\t\tremoved = true\n\t\t\t}\n\t\t}\n\t\tif removed && IsContentFile(ev.Name)\
216
+ \ {\n\t\t\th.removePageByFilename(ev.Name)\n\t\t}\n\n\t\tsourceReallyChanged =\
217
+ \ append(sourceReallyChanged, ev)\n\t\tsourceFilesChanged[ev.Name] = true\n\t\
218
+ }\n\n\tfor shortcode := range shortcodesChanged {\n\t\t// There are certain scenarios\
219
+ \ that, when a shortcode changes,\n\t\t// it isn't sufficient to just rerender\
220
+ \ the already parsed shortcode.\n\t\t// One example is if the user adds a new\
221
+ \ shortcode to the content file first,\n\t\t// and then creates the shortcode\
222
+ \ on the file system.\n\t\t// To handle these scenarios, we must do a full reprocessing\
223
+ \ of the\n\t\t// pages that keeps a reference to the changed shortcode.\n\t\t\
224
+ pagesWithShortcode := h.findPagesByShortcode(shortcode)\n\t\tfor _, p := range\
225
+ \ pagesWithShortcode {\n\t\t\tcontentFilesChanged = append(contentFilesChanged,\
226
+ \ p.File().Filename())\n\t\t}\n\t}\n\n\tif len(sourceReallyChanged) > 0 || len(contentFilesChanged)\
227
+ \ > 0 {\n\t\tvar filenamesChanged []string\n\t\tfor _, e := range sourceReallyChanged\
228
+ \ {\n\t\t\tfilenamesChanged = append(filenamesChanged, e.Name)\n\t\t}\n\t\tif\
229
+ \ len(contentFilesChanged) > 0 {\n\t\t\tfilenamesChanged = append(filenamesChanged,\
230
+ \ contentFilesChanged...)\n\t\t}\n\n\t\tfilenamesChanged = helpers.UniqueStrings(filenamesChanged)\n\
231
+ \n\t\tif err := s.readAndProcessContent(filenamesChanged...); err != nil {\n\t\
232
+ \t\treturn whatChanged{}, err\n\t\t}\n\n\t}\n\n\tchanged := whatChanged{\n\t\t\
233
+ source: len(sourceChanged) > 0 || len(shortcodesChanged) > 0,\n\t\tother: len(tmplChanged)\
234
+ \ > 0 || len(i18nChanged) > 0 || len(dataChanged) > 0,\n\t\tfiles: sourceFilesChanged,\n\
235
+ \t}\n\n\treturn changed, nil\n\n}"
236
+ pipeline_tag: sentence-similarity
237
+ library_name: sentence-transformers
238
+ ---
239
+
240
+ # SentenceTransformer based on Shuu12121/CodeModernBERT-Finch
241
+
242
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [Shuu12121/CodeModernBERT-Finch](https://huggingface.co/Shuu12121/CodeModernBERT-Finch). It maps sentences & paragraphs to a 512-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
243
+
244
+ ## Model Details
245
+
246
+ ### Model Description
247
+ - **Model Type:** Sentence Transformer
248
+ - **Base model:** [Shuu12121/CodeModernBERT-Finch](https://huggingface.co/Shuu12121/CodeModernBERT-Finch) <!-- at revision cb1142a6a402471e02d11005b239f349c6d79be0 -->
249
+ - **Maximum Sequence Length:** 1024 tokens
250
+ - **Output Dimensionality:** 512 dimensions
251
+ - **Similarity Function:** Cosine Similarity
252
+ <!-- - **Training Dataset:** Unknown -->
253
+ <!-- - **Language:** Unknown -->
254
+ <!-- - **License:** Unknown -->
255
+
256
+ ### Model Sources
257
+
258
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
259
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
260
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
261
+
262
+ ### Full Model Architecture
263
+
264
+ ```
265
+ SentenceTransformer(
266
+ (0): Transformer({'max_seq_length': 1024, 'do_lower_case': False, 'architecture': 'ModernBertModel'})
267
+ (1): Pooling({'word_embedding_dimension': 512, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
268
+ )
269
+ ```
270
+
271
+ ## Usage
272
+
273
+ ### Direct Usage (Sentence Transformers)
274
+
275
+ First install the Sentence Transformers library:
276
+
277
+ ```bash
278
+ pip install -U sentence-transformers
279
+ ```
280
+
281
+ Then you can load this model and run inference.
282
+ ```python
283
+ from sentence_transformers import SentenceTransformer
284
+
285
+ # Download from the 🤗 Hub
286
+ model = SentenceTransformer("sentence_transformers_model_id")
287
+ # Run inference
288
+ sentences = [
289
+ '// reBuild partially rebuilds a site given the filesystem events.\n// It returns whetever the content source was changed.\n// TODO(bep) clean up/rewrite this method.',
290
+ 'func (s *Site) processPartial(events []fsnotify.Event) (whatChanged, error) {\n\n\tevents = s.filterFileEvents(events)\n\tevents = s.translateFileEvents(events)\n\n\ts.Log.DEBUG.Printf("Rebuild for events %q", events)\n\n\th := s.h\n\n\t// First we need to determine what changed\n\n\tvar (\n\t\tsourceChanged = []fsnotify.Event{}\n\t\tsourceReallyChanged = []fsnotify.Event{}\n\t\tcontentFilesChanged []string\n\t\ttmplChanged = []fsnotify.Event{}\n\t\tdataChanged = []fsnotify.Event{}\n\t\ti18nChanged = []fsnotify.Event{}\n\t\tshortcodesChanged = make(map[string]bool)\n\t\tsourceFilesChanged = make(map[string]bool)\n\n\t\t// prevent spamming the log on changes\n\t\tlogger = helpers.NewDistinctFeedbackLogger()\n\t)\n\n\tcachePartitions := make([]string, len(events))\n\n\tfor i, ev := range events {\n\t\tcachePartitions[i] = resources.ResourceKeyPartition(ev.Name)\n\n\t\tif s.isContentDirEvent(ev) {\n\t\t\tlogger.Println("Source changed", ev)\n\t\t\tsourceChanged = append(sourceChanged, ev)\n\t\t}\n\t\tif s.isLayoutDirEvent(ev) {\n\t\t\tlogger.Println("Template changed", ev)\n\t\t\ttmplChanged = append(tmplChanged, ev)\n\n\t\t\tif strings.Contains(ev.Name, "shortcodes") {\n\t\t\t\tshortcode := filepath.Base(ev.Name)\n\t\t\t\tshortcode = strings.TrimSuffix(shortcode, filepath.Ext(shortcode))\n\t\t\t\tshortcodesChanged[shortcode] = true\n\t\t\t}\n\t\t}\n\t\tif s.isDataDirEvent(ev) {\n\t\t\tlogger.Println("Data changed", ev)\n\t\t\tdataChanged = append(dataChanged, ev)\n\t\t}\n\t\tif s.isI18nEvent(ev) {\n\t\t\tlogger.Println("i18n changed", ev)\n\t\t\ti18nChanged = append(dataChanged, ev)\n\t\t}\n\t}\n\n\t// These in memory resource caches will be rebuilt on demand.\n\tfor _, s := range s.h.Sites {\n\t\ts.ResourceSpec.ResourceCache.DeletePartitions(cachePartitions...)\n\t}\n\n\tif len(tmplChanged) > 0 || len(i18nChanged) > 0 {\n\t\tsites := s.h.Sites\n\t\tfirst := sites[0]\n\n\t\ts.h.init.Reset()\n\n\t\t// TOD(bep) globals clean\n\t\tif err := first.Deps.LoadResources(); err != nil {\n\t\t\treturn whatChanged{}, err\n\t\t}\n\n\t\tfor i := 1; i < len(sites); i++ {\n\t\t\tsite := sites[i]\n\t\t\tvar err error\n\t\t\tdepsCfg := deps.DepsCfg{\n\t\t\t\tLanguage: site.language,\n\t\t\t\tMediaTypes: site.mediaTypesConfig,\n\t\t\t\tOutputFormats: site.outputFormatsConfig,\n\t\t\t}\n\t\t\tsite.Deps, err = first.Deps.ForLanguage(depsCfg, func(d *deps.Deps) error {\n\t\t\t\td.Site = &site.Info\n\t\t\t\treturn nil\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn whatChanged{}, err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(dataChanged) > 0 {\n\t\ts.h.init.data.Reset()\n\t}\n\n\tfor _, ev := range sourceChanged {\n\t\tremoved := false\n\n\t\tif ev.Op&fsnotify.Remove == fsnotify.Remove {\n\t\t\tremoved = true\n\t\t}\n\n\t\t// Some editors (Vim) sometimes issue only a Rename operation when writing an existing file\n\t\t// Sometimes a rename operation means that file has been renamed other times it means\n\t\t// it\'s been updated\n\t\tif ev.Op&fsnotify.Rename == fsnotify.Rename {\n\t\t\t// If the file is still on disk, it\'s only been updated, if it\'s not, it\'s been moved\n\t\t\tif ex, err := afero.Exists(s.Fs.Source, ev.Name); !ex || err != nil {\n\t\t\t\tremoved = true\n\t\t\t}\n\t\t}\n\t\tif removed && IsContentFile(ev.Name) {\n\t\t\th.removePageByFilename(ev.Name)\n\t\t}\n\n\t\tsourceReallyChanged = append(sourceReallyChanged, ev)\n\t\tsourceFilesChanged[ev.Name] = true\n\t}\n\n\tfor shortcode := range shortcodesChanged {\n\t\t// There are certain scenarios that, when a shortcode changes,\n\t\t// it isn\'t sufficient to just rerender the already parsed shortcode.\n\t\t// One example is if the user adds a new shortcode to the content file first,\n\t\t// and then creates the shortcode on the file system.\n\t\t// To handle these scenarios, we must do a full reprocessing of the\n\t\t// pages that keeps a reference to the changed shortcode.\n\t\tpagesWithShortcode := h.findPagesByShortcode(shortcode)\n\t\tfor _, p := range pagesWithShortcode {\n\t\t\tcontentFilesChanged = append(contentFilesChanged, p.File().Filename())\n\t\t}\n\t}\n\n\tif len(sourceReallyChanged) > 0 || len(contentFilesChanged) > 0 {\n\t\tvar filenamesChanged []string\n\t\tfor _, e := range sourceReallyChanged {\n\t\t\tfilenamesChanged = append(filenamesChanged, e.Name)\n\t\t}\n\t\tif len(contentFilesChanged) > 0 {\n\t\t\tfilenamesChanged = append(filenamesChanged, contentFilesChanged...)\n\t\t}\n\n\t\tfilenamesChanged = helpers.UniqueStrings(filenamesChanged)\n\n\t\tif err := s.readAndProcessContent(filenamesChanged...); err != nil {\n\t\t\treturn whatChanged{}, err\n\t\t}\n\n\t}\n\n\tchanged := whatChanged{\n\t\tsource: len(sourceChanged) > 0 || len(shortcodesChanged) > 0,\n\t\tother: len(tmplChanged) > 0 || len(i18nChanged) > 0 || len(dataChanged) > 0,\n\t\tfiles: sourceFilesChanged,\n\t}\n\n\treturn changed, nil\n\n}',
291
+ 'func WebPageImageResolver(doc *goquery.Document) ([]candidate, int) {\n\timgs := doc.Find("img")\n\n\tvar candidates []candidate\n\tsignificantSurface := 320 * 200\n\tsignificantSurfaceCount := 0\n\tsrc := ""\n\timgs.Each(func(i int, tag *goquery.Selection) {\n\t\tvar surface int\n\t\tsrc = getImageSrc(tag)\n\t\tif src == "" {\n\t\t\treturn\n\t\t}\n\n\t\twidth, _ := tag.Attr("width")\n\t\theight, _ := tag.Attr("height")\n\t\tif width != "" {\n\t\t\tw, _ := strconv.Atoi(width)\n\t\t\tif height != "" {\n\t\t\t\th, _ := strconv.Atoi(height)\n\t\t\t\tsurface = w * h\n\t\t\t} else {\n\t\t\t\tsurface = w\n\t\t\t}\n\t\t} else {\n\t\t\tif height != "" {\n\t\t\t\tsurface, _ = strconv.Atoi(height)\n\t\t\t} else {\n\t\t\t\tsurface = 0\n\t\t\t}\n\t\t}\n\n\t\tif surface > significantSurface {\n\t\t\tsignificantSurfaceCount++\n\t\t}\n\n\t\ttagscore := score(tag)\n\t\tif tagscore >= 0 {\n\t\t\tc := candidate{\n\t\t\t\turl: src,\n\t\t\t\tsurface: surface,\n\t\t\t\tscore: score(tag),\n\t\t\t}\n\t\t\tcandidates = append(candidates, c)\n\t\t}\n\t})\n\n\tif len(candidates) == 0 {\n\t\treturn nil, 0\n\t}\n\n\treturn candidates, significantSurfaceCount\n\n}',
292
+ ]
293
+ embeddings = model.encode(sentences)
294
+ print(embeddings.shape)
295
+ # [3, 512]
296
+
297
+ # Get the similarity scores for the embeddings
298
+ similarities = model.similarity(embeddings, embeddings)
299
+ print(similarities)
300
+ # tensor([[1.0000, 0.6671, 0.2242],
301
+ # [0.6671, 1.0000, 0.3125],
302
+ # [0.2242, 0.3125, 1.0000]])
303
+ ```
304
+
305
+ <!--
306
+ ### Direct Usage (Transformers)
307
+
308
+ <details><summary>Click to see the direct usage in Transformers</summary>
309
+
310
+ </details>
311
+ -->
312
+
313
+ <!--
314
+ ### Downstream Usage (Sentence Transformers)
315
+
316
+ You can finetune this model on your own dataset.
317
+
318
+ <details><summary>Click to expand</summary>
319
+
320
+ </details>
321
+ -->
322
+
323
+ <!--
324
+ ### Out-of-Scope Use
325
+
326
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
327
+ -->
328
+
329
+ <!--
330
+ ## Bias, Risks and Limitations
331
+
332
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
333
+ -->
334
+
335
+ <!--
336
+ ### Recommendations
337
+
338
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
339
+ -->
340
+
341
+ ## Training Details
342
+
343
+ ### Training Dataset
344
+
345
+ #### Unnamed Dataset
346
+
347
+ * Size: 58,800 training samples
348
+ * Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>label</code>
349
+ * Approximate statistics based on the first 1000 samples:
350
+ | | sentence_0 | sentence_1 | label |
351
+ |:--------|:------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------|:--------------------------------------------------------------|
352
+ | type | string | string | float |
353
+ | details | <ul><li>min: 3 tokens</li><li>mean: 55.73 tokens</li><li>max: 1024 tokens</li></ul> | <ul><li>min: 28 tokens</li><li>mean: 179.65 tokens</li><li>max: 1024 tokens</li></ul> | <ul><li>min: 1.0</li><li>mean: 1.0</li><li>max: 1.0</li></ul> |
354
+ * Samples:
355
+ | sentence_0 | sentence_1 | label |
356
+ |:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------|
357
+ | <code>// CASNext is a non-callback, loop-based version of CAS method.<br>//<br>// Usage is like this:<br>//<br>// var state memcached.CASState<br>// for client.CASNext(vb, key, exp, &state) {<br>// state.Value = some_mutation(state.Value)<br>// }<br>// if state.Err != nil { ... }</code> | <code>func (c *Client) CASNext(vb uint16, k string, exp int, state *CASState) bool {<br> if state.initialized {<br> if !state.Exists {<br> // Adding a new key:<br> if state.Value == nil {<br> state.Cas = 0<br> return false // no-op (delete of non-existent value)<br> }<br> state.resp, state.Err = c.Add(vb, k, 0, exp, state.Value)<br> } else {<br> // Updating / deleting a key:<br> req := &gomemcached.MCRequest{<br> Opcode: gomemcached.DELETE,<br> VBucket: vb,<br> Key: []byte(k),<br> Cas: state.Cas}<br> if state.Value != nil {<br> req.Opcode = gomemcached.SET<br> req.Opaque = 0<br> req.Extras = []byte{0, 0, 0, 0, 0, 0, 0, 0}<br> req.Body = state.Value<br><br> flags := 0<br> exp := 0 // ??? Should we use initialexp here instead?<br> binary.BigEndian.PutUint64(req.Extras, uint64(flags)<<32|uint64(exp))<br> }<br> state.resp, state.Err = c.Send(req)<br> }<br><br> // If the response status is KEY_EEXISTS or NOT_STORED there's a conflict and we'll need to<br> // get the new value (below). Otherwise, we're done (either ...</code> | <code>1.0</code> |
358
+ | <code>// RestoreResourcePools restores a bulk of resource pools, usually from a backup.</code> | <code>func (f *Facade) RestoreResourcePools(ctx datastore.Context, pools []pool.ResourcePool) error {<br> defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.RestoreResourcePools"))<br> // Do not DFSLock here, ControlPlaneDao does that<br> var alog audit.Logger<br> for _, pool := range pools {<br> alog = f.auditLogger.Message(ctx, "Adding ResourcePool").Action(audit.Add).Entity(&pool)<br> pool.DatabaseVersion = 0<br> if err := f.addResourcePool(ctx, &pool); err != nil {<br> if err == ErrPoolExists {<br> if err := f.updateResourcePool(ctx, &pool); err != nil {<br> glog.Errorf("Could not restore resource pool %s via update: %s", pool.ID, err)<br> return alog.Error(err)<br> }<br> } else {<br> glog.Errorf("Could not restore resource pool %s via add: %s", pool.ID, err)<br> return alog.Error(err)<br> }<br> }<br> alog.Succeeded()<br> }<br> return nil<br>}</code> | <code>1.0</code> |
359
+ | <code>// run starts a goroutine to handle client connects and broadcast events.</code> | <code>func (s *Streamer) run() {<br> go func() {<br> for {<br> select {<br> case cl := <-s.connecting:<br> s.clients[cl] = true<br><br> case cl := <-s.disconnecting:<br> delete(s.clients, cl)<br><br> case event := <-s.event:<br> for cl := range s.clients {<br> // TODO: non-blocking broadcast<br> //select {<br> //case cl <- event: // Try to send event to client<br> //default:<br> // fmt.Println("Channel full. Discarding value")<br> //}<br> cl <- event<br> }<br> }<br> }<br> }()<br>}</code> | <code>1.0</code> |
360
+ * Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
361
+ ```json
362
+ {
363
+ "scale": 20.0,
364
+ "similarity_fct": "cos_sim"
365
+ }
366
+ ```
367
+
368
+ ### Training Hyperparameters
369
+ #### Non-Default Hyperparameters
370
+
371
+ - `per_device_train_batch_size`: 200
372
+ - `per_device_eval_batch_size`: 200
373
+ - `fp16`: True
374
+ - `multi_dataset_batch_sampler`: round_robin
375
+
376
+ #### All Hyperparameters
377
+ <details><summary>Click to expand</summary>
378
+
379
+ - `overwrite_output_dir`: False
380
+ - `do_predict`: False
381
+ - `eval_strategy`: no
382
+ - `prediction_loss_only`: True
383
+ - `per_device_train_batch_size`: 200
384
+ - `per_device_eval_batch_size`: 200
385
+ - `per_gpu_train_batch_size`: None
386
+ - `per_gpu_eval_batch_size`: None
387
+ - `gradient_accumulation_steps`: 1
388
+ - `eval_accumulation_steps`: None
389
+ - `torch_empty_cache_steps`: None
390
+ - `learning_rate`: 5e-05
391
+ - `weight_decay`: 0.0
392
+ - `adam_beta1`: 0.9
393
+ - `adam_beta2`: 0.999
394
+ - `adam_epsilon`: 1e-08
395
+ - `max_grad_norm`: 1
396
+ - `num_train_epochs`: 3
397
+ - `max_steps`: -1
398
+ - `lr_scheduler_type`: linear
399
+ - `lr_scheduler_kwargs`: {}
400
+ - `warmup_ratio`: 0.0
401
+ - `warmup_steps`: 0
402
+ - `log_level`: passive
403
+ - `log_level_replica`: warning
404
+ - `log_on_each_node`: True
405
+ - `logging_nan_inf_filter`: True
406
+ - `save_safetensors`: True
407
+ - `save_on_each_node`: False
408
+ - `save_only_model`: False
409
+ - `restore_callback_states_from_checkpoint`: False
410
+ - `no_cuda`: False
411
+ - `use_cpu`: False
412
+ - `use_mps_device`: False
413
+ - `seed`: 42
414
+ - `data_seed`: None
415
+ - `jit_mode_eval`: False
416
+ - `use_ipex`: False
417
+ - `bf16`: False
418
+ - `fp16`: True
419
+ - `fp16_opt_level`: O1
420
+ - `half_precision_backend`: auto
421
+ - `bf16_full_eval`: False
422
+ - `fp16_full_eval`: False
423
+ - `tf32`: None
424
+ - `local_rank`: 0
425
+ - `ddp_backend`: None
426
+ - `tpu_num_cores`: None
427
+ - `tpu_metrics_debug`: False
428
+ - `debug`: []
429
+ - `dataloader_drop_last`: False
430
+ - `dataloader_num_workers`: 0
431
+ - `dataloader_prefetch_factor`: None
432
+ - `past_index`: -1
433
+ - `disable_tqdm`: False
434
+ - `remove_unused_columns`: True
435
+ - `label_names`: None
436
+ - `load_best_model_at_end`: False
437
+ - `ignore_data_skip`: False
438
+ - `fsdp`: []
439
+ - `fsdp_min_num_params`: 0
440
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
441
+ - `fsdp_transformer_layer_cls_to_wrap`: None
442
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
443
+ - `deepspeed`: None
444
+ - `label_smoothing_factor`: 0.0
445
+ - `optim`: adamw_torch
446
+ - `optim_args`: None
447
+ - `adafactor`: False
448
+ - `group_by_length`: False
449
+ - `length_column_name`: length
450
+ - `ddp_find_unused_parameters`: None
451
+ - `ddp_bucket_cap_mb`: None
452
+ - `ddp_broadcast_buffers`: False
453
+ - `dataloader_pin_memory`: True
454
+ - `dataloader_persistent_workers`: False
455
+ - `skip_memory_metrics`: True
456
+ - `use_legacy_prediction_loop`: False
457
+ - `push_to_hub`: False
458
+ - `resume_from_checkpoint`: None
459
+ - `hub_model_id`: None
460
+ - `hub_strategy`: every_save
461
+ - `hub_private_repo`: None
462
+ - `hub_always_push`: False
463
+ - `hub_revision`: None
464
+ - `gradient_checkpointing`: False
465
+ - `gradient_checkpointing_kwargs`: None
466
+ - `include_inputs_for_metrics`: False
467
+ - `include_for_metrics`: []
468
+ - `eval_do_concat_batches`: True
469
+ - `fp16_backend`: auto
470
+ - `push_to_hub_model_id`: None
471
+ - `push_to_hub_organization`: None
472
+ - `mp_parameters`:
473
+ - `auto_find_batch_size`: False
474
+ - `full_determinism`: False
475
+ - `torchdynamo`: None
476
+ - `ray_scope`: last
477
+ - `ddp_timeout`: 1800
478
+ - `torch_compile`: False
479
+ - `torch_compile_backend`: None
480
+ - `torch_compile_mode`: None
481
+ - `include_tokens_per_second`: False
482
+ - `include_num_input_tokens_seen`: False
483
+ - `neftune_noise_alpha`: None
484
+ - `optim_target_modules`: None
485
+ - `batch_eval_metrics`: False
486
+ - `eval_on_start`: False
487
+ - `use_liger_kernel`: False
488
+ - `liger_kernel_config`: None
489
+ - `eval_use_gather_object`: False
490
+ - `average_tokens_across_devices`: False
491
+ - `prompts`: None
492
+ - `batch_sampler`: batch_sampler
493
+ - `multi_dataset_batch_sampler`: round_robin
494
+ - `router_mapping`: {}
495
+ - `learning_rate_mapping`: {}
496
+
497
+ </details>
498
+
499
+ ### Training Logs
500
+ | Epoch | Step | Training Loss |
501
+ |:------:|:----:|:-------------:|
502
+ | 1.7007 | 500 | 0.2697 |
503
+
504
+
505
+ ### Framework Versions
506
+ - Python: 3.10.12
507
+ - Sentence Transformers: 5.0.0
508
+ - Transformers: 4.53.1
509
+ - PyTorch: 2.7.0+cu128
510
+ - Accelerate: 1.7.0
511
+ - Datasets: 3.6.0
512
+ - Tokenizers: 0.21.2
513
+
514
+ ## Citation
515
+
516
+ ### BibTeX
517
+
518
+ #### Sentence Transformers
519
+ ```bibtex
520
+ @inproceedings{reimers-2019-sentence-bert,
521
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
522
+ author = "Reimers, Nils and Gurevych, Iryna",
523
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
524
+ month = "11",
525
+ year = "2019",
526
+ publisher = "Association for Computational Linguistics",
527
+ url = "https://arxiv.org/abs/1908.10084",
528
+ }
529
+ ```
530
+
531
+ #### MultipleNegativesRankingLoss
532
+ ```bibtex
533
+ @misc{henderson2017efficient,
534
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
535
+ 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},
536
+ year={2017},
537
+ eprint={1705.00652},
538
+ archivePrefix={arXiv},
539
+ primaryClass={cs.CL}
540
+ }
541
+ ```
542
+
543
+ <!--
544
+ ## Glossary
545
+
546
+ *Clearly define terms in order to be accessible across audiences.*
547
+ -->
548
+
549
+ <!--
550
+ ## Model Card Authors
551
+
552
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
553
+ -->
554
+
555
+ <!--
556
+ ## Model Card Contact
557
+
558
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
559
+ -->
added_tokens.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "</s>": 30001,
3
+ "<mask>": 30004,
4
+ "<pad>": 30003,
5
+ "<s>": 30000,
6
+ "<unk>": 30002
7
+ }
config.json ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "ModernBertModel"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "attention_probs_dropout_prob": 0.1,
8
+ "bos_token_id": 30000,
9
+ "classifier_activation": "gelu",
10
+ "classifier_bias": false,
11
+ "classifier_dropout": 0.0,
12
+ "classifier_pooling": "cls",
13
+ "cls_token_id": 50281,
14
+ "decoder_bias": true,
15
+ "deterministic_flash_attn": false,
16
+ "embedding_dropout": 0.0,
17
+ "eos_token_id": 30001,
18
+ "global_attn_every_n_layers": 3,
19
+ "global_rope_theta": 160000.0,
20
+ "hidden_activation": "gelu",
21
+ "hidden_dropout_prob": 0.1,
22
+ "hidden_size": 512,
23
+ "initializer_cutoff_factor": 2.0,
24
+ "initializer_range": 0.02,
25
+ "intermediate_size": 2048,
26
+ "local_attention": 128,
27
+ "local_attention_rope_theta": 10000,
28
+ "local_attention_window": 128,
29
+ "local_rope_theta": 10000.0,
30
+ "max_position_embeddings": 8192,
31
+ "mlp_bias": false,
32
+ "mlp_dropout": 0.0,
33
+ "model_type": "modernbert",
34
+ "norm_bias": false,
35
+ "norm_eps": 1e-05,
36
+ "num_attention_heads": 8,
37
+ "num_hidden_layers": 6,
38
+ "pad_token_id": 1,
39
+ "repad_logits_with_grad": false,
40
+ "rope_theta": 160000,
41
+ "sep_token_id": 50282,
42
+ "sparse_pred_ignore_index": -100,
43
+ "sparse_prediction": false,
44
+ "torch_dtype": "float32",
45
+ "transformers_version": "4.53.1",
46
+ "type_vocab_size": 2,
47
+ "vocab_size": 30005
48
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "SentenceTransformer",
3
+ "__version__": {
4
+ "sentence_transformers": "5.0.0",
5
+ "transformers": "4.53.1",
6
+ "pytorch": "2.7.0+cu128"
7
+ },
8
+ "prompts": {
9
+ "query": "",
10
+ "document": ""
11
+ },
12
+ "default_prompt_name": null,
13
+ "similarity_fn_name": "cosine"
14
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e0d9d8597cf0feb08e28d116d717de8d0ea1c5173e8a196cbf5349647357d1b
3
+ size 162143824
modules.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ }
14
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 1024,
3
+ "do_lower_case": false
4
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "<s>",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": true,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": true,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "<pad>",
32
+ "lstrip": false,
33
+ "normalized": true,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "</s>",
39
+ "lstrip": false,
40
+ "normalized": true,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "<unk>",
46
+ "lstrip": false,
47
+ "normalized": true,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "30000": {
5
+ "content": "<s>",
6
+ "lstrip": false,
7
+ "normalized": true,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "30001": {
13
+ "content": "</s>",
14
+ "lstrip": false,
15
+ "normalized": true,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "30002": {
21
+ "content": "<unk>",
22
+ "lstrip": false,
23
+ "normalized": true,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "30003": {
29
+ "content": "<pad>",
30
+ "lstrip": false,
31
+ "normalized": true,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "30004": {
37
+ "content": "<mask>",
38
+ "lstrip": true,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ }
44
+ },
45
+ "bos_token": "<s>",
46
+ "clean_up_tokenization_spaces": false,
47
+ "cls_token": "<s>",
48
+ "eos_token": "</s>",
49
+ "errors": "replace",
50
+ "extra_special_tokens": {},
51
+ "mask_token": "<mask>",
52
+ "max_length": 256,
53
+ "model_max_length": 1000000000000000019884624838656,
54
+ "pad_token": "<pad>",
55
+ "sep_token": "</s>",
56
+ "stride": 0,
57
+ "tokenizer_class": "RobertaTokenizer",
58
+ "trim_offsets": true,
59
+ "truncation_side": "right",
60
+ "truncation_strategy": "longest_first",
61
+ "unk_token": "<unk>"
62
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff