---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- dense
- generated_from_trainer
- dataset_size:8003584
- loss:CachedMultipleNegativesRankingLoss
base_model: Shuu12121/CodeModernBERT-Crow-v3-large-len1024
widget:
- source_sentence: WithUUID adds the uuid to the snapshot policy collection get params
sentences:
- "func (o *SnapshotPolicyCollectionGetParams) WithUUID(uuid *string) *SnapshotPolicyCollectionGetParams\
\ {\n\to.SetUUID(uuid)\n\treturn o\n}"
- "func (c *SageMaker) DescribeHumanTaskUi(input *DescribeHumanTaskUiInput) (*DescribeHumanTaskUiOutput,\
\ error) {\n\treq, out := c.DescribeHumanTaskUiRequest(input)\n\treturn out, req.Send()\n\
}"
- "func (_mock *Client) GetImportRequest(context1 context.Context, getImportRequestArgs\
\ git.GetImportRequestArgs) (*git.GitImportRequest, error) {\n\tret := _mock.Called(context1,\
\ getImportRequestArgs)\n\n\tif len(ret) == 0 {\n\t\tpanic(\"no return value specified\
\ for GetImportRequest\")\n\t}\n\n\tvar r0 *git.GitImportRequest\n\tvar r1 error\n\
\tif returnFunc, ok := ret.Get(0).(func(context.Context, git.GetImportRequestArgs)\
\ (*git.GitImportRequest, error)); ok {\n\t\treturn returnFunc(context1, getImportRequestArgs)\n\
\t}\n\tif returnFunc, ok := ret.Get(0).(func(context.Context, git.GetImportRequestArgs)\
\ *git.GitImportRequest); ok {\n\t\tr0 = returnFunc(context1, getImportRequestArgs)\n\
\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*git.GitImportRequest)\n\
\t\t}\n\t}\n\tif returnFunc, ok := ret.Get(1).(func(context.Context, git.GetImportRequestArgs)\
\ error); ok {\n\t\tr1 = returnFunc(context1, getImportRequestArgs)\n\t} else\
\ {\n\t\tr1 = ret.Error(1)\n\t}\n\treturn r0, r1\n}"
- source_sentence: 'RegisterRegionSslCertificatesHandlerServer registers the http
handlers for service RegionSslCertificates to "mux".
UnaryRPC :call RegionSslCertificatesServer directly.
StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
Note that using this registration option will cause many gRPC library features
to stop working. Consider using RegisterRegionSslCertificatesHandlerFromEndpoint
instead.'
sentences:
- "func (in *ByoipCIDREvent) DeepCopy() *ByoipCIDREvent {\n\tif in == nil {\n\t\t\
return nil\n\t}\n\tout := new(ByoipCIDREvent)\n\tin.DeepCopyInto(out)\n\treturn\
\ out\n}"
- "func RegisterRegionSslCertificatesHandlerServer(ctx context.Context, mux *runtime.ServeMux,\
\ server RegionSslCertificatesServer) error {\n\n\tmux.Handle(\"DELETE\", pattern_RegionSslCertificates_Delete_0,\
\ func(w http.ResponseWriter, req *http.Request, pathParams map[string]string)\
\ {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\
\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx,\
\ &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux,\
\ req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext,\
\ err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/mockgcp.cloud.compute.v1.RegionSslCertificates/Delete\"\
, runtime.WithHTTPPathPattern(\"/compute/v1/projects/{project}/regions/{region}/sslCertificates/{ssl_certificate}\"\
))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler,\
\ w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RegionSslCertificates_Delete_0(annotatedContext,\
\ inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD =\
\ metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\
\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\
\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler,\
\ w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RegionSslCertificates_Delete_0(annotatedContext,\
\ mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\
\t})\n\n\tmux.Handle(\"GET\", pattern_RegionSslCertificates_Get_0, func(w http.ResponseWriter,\
\ req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\
\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx,\
\ &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux,\
\ req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext,\
\ err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/mockgcp.cloud.compute.v1.RegionSslCertificates/Get\"\
, runtime.WithHTTPPathPattern(\"/compute/v1/projects/{project}/regions/{region}/sslCertificates/{ssl_certificate}\"\
))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler,\
\ w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RegionSslCertificates_Get_0(annotatedContext,\
\ inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD =\
\ metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\
\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\
\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler,\
\ w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RegionSslCertificates_Get_0(annotatedContext,\
\ mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\
\t})\n\n\tmux.Handle(\"POST\", pattern_RegionSslCertificates_Insert_0, func(w\
\ http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\t\
ctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar\
\ stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx,\
\ &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux,\
\ req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext,\
\ err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/mockgcp.cloud.compute.v1.RegionSslCertificates/Insert\"\
, runtime.WithHTTPPathPattern(\"/compute/v1/projects/{project}/regions/{region}/sslCertificates\"\
))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler,\
\ w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RegionSslCertificates_Insert_0(annotatedContext,\
\ inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD =\
\ metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\
\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\
\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler,\
\ w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RegionSslCertificates_Insert_0(annotatedContext,\
\ mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\
\t})\n\n\tmux.Handle(\"GET\", pattern_RegionSslCertificates_List_0, func(w http.ResponseWriter,\
\ req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\
\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx,\
\ &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux,\
\ req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext,\
\ err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/mockgcp.cloud.compute.v1.RegionSslCertificates/List\"\
, runtime.WithHTTPPathPattern(\"/compute/v1/projects/{project}/regions/{region}/sslCertificates\"\
))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler,\
\ w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RegionSslCertificates_List_0(annotatedContext,\
\ inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD =\
\ metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\
\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\
\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler,\
\ w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RegionSslCertificates_List_0(annotatedContext,\
\ mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\
\t})\n\n\treturn nil\n}"
- "func (m *ItemScheduleRequestBuilder) Delete(ctx context.Context, requestConfiguration\
\ *ItemScheduleRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo,\
\ err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err\
\ != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings\
\ {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n\
\ \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n\
\ }\n err = m.requestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n\
\ if err != nil {\n return err\n }\n return nil\n}"
- source_sentence: 'signPSSWithSalt calculates the signature of hashed using PSS [1]
with specified salt.
Note that hashed must be the result of hashing the input message using the
given hash function. salt is a random sequence of bytes whose length will be
later used to verify the signature.'
sentences:
- "func signPSSWithSalt(rand io.Reader, priv *PrivateKey, hash crypto.Hash, hashed,\
\ salt []byte) (s []byte, err error) {\n\tnBits := priv.N.BitLen()\n\tem, err\
\ := emsaPSSEncode(hashed, nBits-1, salt, hash.New())\n\tif err != nil {\n\t\t\
return\n\t}\n\tm := new(big.Int).SetBytes(em)\n\tc, err := decryptAndCheck(rand,\
\ priv, m)\n\tif err != nil {\n\t\treturn\n\t}\n\ts = make([]byte, (nBits+7)/8)\n\
\tcopyWithLeftPad(s, c.Bytes())\n\treturn\n}"
- "func (iow *IOWrapper) Close() error {\n\tdefer iow.lockUnlock()()\n\n\tif c :=\
\ iow.Closer; c != nil {\n\t\treturn c.Close()\n\t}\n\treturn nil\n}"
- "func (mr *MockEnsurerMockRecorder) EnsureAdditionalFiles(ctx, gctx, new, old\
\ any) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock,\
\ \"EnsureAdditionalFiles\", reflect.TypeOf((*MockEnsurer)(nil).EnsureAdditionalFiles),\
\ ctx, gctx, new, old)\n}"
- source_sentence: 'PutBlobPartial attempts to create a blob using the data that is
already present
at the destination. chunkAccessor is accessed in a non-sequential way to retrieve
the missing chunks.
It is available only if SupportsPutBlobPartial().
Even if SupportsPutBlobPartial() returns true, the call can fail, in which case
the caller
should fall back to PutBlobWithOptions.'
sentences:
- "func (v *VmmToVmmNetworkMappingSettings) UnmarshalJSON(data []byte) error {\n\
\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg);\
\ err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", v, err)\n\
\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\
\tcase \"instanceType\":\n\t\t\terr = unpopulate(val, \"InstanceType\", &v.InstanceType)\n\
\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"\
unmarshalling type %T: %v\", v, err)\n\t\t}\n\t}\n\treturn nil\n}"
- "func (d *ociArchiveImageDestination) PutBlobPartial(ctx context.Context, chunkAccessor\
\ private.BlobChunkAccessor, srcInfo types.BlobInfo, options private.PutBlobPartialOptions)\
\ (private.UploadedBlob, error) {\n\treturn d.unpackedDest.PutBlobPartial(ctx,\
\ chunkAccessor, srcInfo, options)\n}"
- "func (p *parserMixin) Ints() (target *[]int) {\n\ttarget = new([]int)\n\tp.IntsVar(target)\n\
\treturn\n}"
- source_sentence: OnEachBatchTx registers a handler for a specific event type that
is contingent on a transaction.
sentences:
- "func (ResourceGroupState) Values() []ResourceGroupState {\n\treturn []ResourceGroupState{\n\
\t\t\"CREATING\",\n\t\t\"CREATE_COMPLETE\",\n\t\t\"CREATE_FAILED\",\n\t\t\"UPDATING\"\
,\n\t\t\"UPDATE_COMPLETE\",\n\t\t\"UPDATE_FAILED\",\n\t}\n}"
- "func (s *GetDomainDetailOutput) SetAbuseContactEmail(v string) *GetDomainDetailOutput\
\ {\n\ts.AbuseContactEmail = &v\n\treturn s\n}"
- "func OnEachBatchTx[T, TTx comparable](b *Bus, fn func(ctx context.Context, tx\
\ TTx, data []T) error) {\n\tsub := findBus[T, TTx](b)\n\tsub.onBatchTx = append(sub.onBatchTx,\
\ fn)\n}"
pipeline_tag: sentence-similarity
library_name: sentence-transformers
---
# SentenceTransformer based on Shuu12121/CodeModernBERT-Crow-v3-large-len1024
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [Shuu12121/CodeModernBERT-Crow-v3-large-len1024](https://huggingface.co/Shuu12121/CodeModernBERT-Crow-v3-large-len1024). It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
## Model Details
### Model Description
- **Model Type:** Sentence Transformer
- **Base model:** [Shuu12121/CodeModernBERT-Crow-v3-large-len1024](https://huggingface.co/Shuu12121/CodeModernBERT-Crow-v3-large-len1024)
- **Maximum Sequence Length:** 1024 tokens
- **Output Dimensionality:** 1024 dimensions
- **Similarity Function:** Cosine Similarity
### Model Sources
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
### Full Model Architecture
```
SentenceTransformer(
(0): Transformer({'max_seq_length': 1024, 'do_lower_case': False, 'architecture': 'ModernBertModel'})
(1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)
```
## Usage
### Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
```bash
pip install -U sentence-transformers
```
Then you can load this model and run inference.
```python
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("sentence_transformers_model_id")
# Run inference
sentences = [
'OnEachBatchTx registers a handler for a specific event type that is contingent on a transaction.',
'func OnEachBatchTx[T, TTx comparable](b *Bus, fn func(ctx context.Context, tx TTx, data []T) error) {\n\tsub := findBus[T, TTx](b)\n\tsub.onBatchTx = append(sub.onBatchTx, fn)\n}',
'func (s *GetDomainDetailOutput) SetAbuseContactEmail(v string) *GetDomainDetailOutput {\n\ts.AbuseContactEmail = &v\n\treturn s\n}',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.7953, 0.0445],
# [0.7953, 1.0000, 0.0267],
# [0.0445, 0.0267, 1.0000]])
```
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 8,003,584 training samples
* Columns: sentence_0, sentence_1, and label
* Approximate statistics based on the first 1000 samples:
| | sentence_0 | sentence_1 | label |
|:--------|:------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------|:--------------------------------------------------------------|
| type | string | string | float |
| details |
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopicEventSubscriptions_Delete.json | func ExampleDomainTopicEventSubscriptionsClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armeventgrid.NewClientFactory("", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDomainTopicEventSubscriptionsClient().BeginDelete(ctx, "examplerg", "exampleDomain1", "exampleDomainTopic1", "examplesubscription1", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
} | 1.0 |
| newUpgradeContext creates a Context, avoid nil Context member.
only used for testing now. | func newUpgradeContext() Context {
return Context{
Context: context.Background(),
SubTaskConfigs: make(map[string]map[string]config.SubTaskConfig),
}
} | 1.0 |
| ToPostRequestInformation create new navigation property to rules for policies | func (m *RoleManagementPoliciesItemRulesRequestBuilder) ToPostRequestInformation(ctx context.Context, body iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.UnifiedRoleManagementPolicyRuleable, requestConfiguration *RoleManagementPoliciesItemRulesRequestBuilderPostRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()
requestInfo.UrlTemplate = m.urlTemplate
requestInfo.PathParameters = m.pathParameters
requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST
requestInfo.Headers.Add("Accept", "application/json")
err := requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body)
if err != nil {
return nil, err
}
if requestConfiguration != nil {
requestInfo.Headers.AddAll(requestConfiguration.Header... | 1.0 |
* Loss: [CachedMultipleNegativesRankingLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cachedmultiplenegativesrankingloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "cos_sim",
"mini_batch_size": 32,
"gather_across_devices": false
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `per_device_train_batch_size`: 1024
- `per_device_eval_batch_size`: 1024
- `num_train_epochs`: 1
- `fp16`: True
- `multi_dataset_batch_sampler`: round_robin
#### All Hyperparameters