Text Generation
sentence-transformers
English
rag
retrieval-augmented-generation
fastapi
react
chromadb
banking
document-intelligence
vector-search
Instructions to use thilakx/Bankoflibreo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use thilakx/Bankoflibreo with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("thilakx/Bankoflibreo") 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,896 Bytes
342595c | 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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | import { AnyConfig } from './types'
/**
* Sorts modifiers according to following schema:
* - Predefined modifiers are sorted alphabetically
* - When an arbitrary variant appears, it must be preserved which modifiers are before and after it
*/
export const createSortModifiers = (config: AnyConfig) => {
// Pre-compute weights for all known modifiers for O(1) comparison
const modifierWeights = new Map<string, number>()
// Assign weights to sensitive modifiers (highest priority, but preserve order)
config.orderSensitiveModifiers.forEach((mod, index) => {
modifierWeights.set(mod, 1000000 + index) // High weights for sensitive mods
})
return (modifiers: readonly string[]): string[] => {
const result: string[] = []
let currentSegment: string[] = []
// Process modifiers in one pass
for (let i = 0; i < modifiers.length; i++) {
const modifier = modifiers[i]!
// Check if modifier is sensitive (starts with '[' or in orderSensitiveModifiers)
const isArbitrary = modifier[0] === '['
const isOrderSensitive = modifierWeights.has(modifier)
if (isArbitrary || isOrderSensitive) {
// Sort and flush current segment alphabetically
if (currentSegment.length > 0) {
currentSegment.sort()
result.push(...currentSegment)
currentSegment = []
}
result.push(modifier)
} else {
// Regular modifier - add to current segment for batch sorting
currentSegment.push(modifier)
}
}
// Sort and add any remaining segment items
if (currentSegment.length > 0) {
currentSegment.sort()
result.push(...currentSegment)
}
return result
}
}
|