Feature Extraction
sentence-transformers
ONNX
Safetensors
modernbert
code-search
code-embedding
retrieval
dense
text-embeddings-inference
Instructions to use Shuu12121/NightOwl-CodeEmbedding with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Shuu12121/NightOwl-CodeEmbedding with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Shuu12121/NightOwl-CodeEmbedding") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
File size: 1,466 Bytes
cfc3c6d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | # ONNX exports
Source: [Shuu12121/NightOwl-CodeEmbedding](https://huggingface.co/Shuu12121/NightOwl-CodeEmbedding/tree/79140c0e1db457e70067dc0e8089bf2a094324ac)
| File | Precision |
| --- | --- |
| model.onnx | FP32 |
| model_quantized.onnx | Dynamic INT8 (constant MatMul and Gather weights) |
Inputs: `input_ids` and `attention_mask`, int64 `[batch, sequence]`.
Output: `last_hidden_state`. Take the first token, then L2-normalize to obtain
768-dimensional embeddings. Maximum input: 1024 tokens.
Use the tokenizer/configuration at the repository root. Query/document prefixes are not required.
Node.js short-input example (Transformers.js 4.2.0):
```javascript
import { pipeline } from '@huggingface/transformers';
const extractor = await pipeline('feature-extraction', 'Shuu12121/NightOwl-CodeEmbedding', {
dtype: 'q8', device: 'cpu',
});
const output = await extractor('parse a JSON string', { pooling: 'cls', normalize: true });
console.log(output.dims); // [1, 768]
await extractor.dispose();
```
For long inputs, truncate the content to 1022 tokens before adding
CLS and SEP. Transformers.js 4.2.0's default truncation slices the final sequence and
can remove SEP; preserve both special tokens for parity with the Python tokenizer.
`manifest.json` records the source commit, export settings, validation results and
SHA256 checksums. These exports use opset 17. The original model's
license and usage terms apply. INT8 output embeddings remain FP32.
|