Sentence Similarity
sentence-transformers
Safetensors
feature-extraction
Generated from Trainer
dataset_size:13734
loss:MultipleNegativesRankingLoss
Instructions to use csolaina/lora_r8_a16_d5_bs16_ep1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use csolaina/lora_r8_a16_d5_bs16_ep1 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("csolaina/lora_r8_a16_d5_bs16_ep1") sentences = [ "test common check as frame", " def predict_proba(self, raw_prediction):\n \"\"\"Predict probabilities.\n\n Parameters\n ----------\n raw_prediction : array of shape (n_samples,) or (n_samples, 1)\n Raw prediction values (in link space).\n\n Returns\n -------\n proba : array of shape (n_samples, 2)\n Element-wise class probabilities.\n \"\"\"\n # Be graceful to shape (n_samples, 1) -> (n_samples,)\n if raw_prediction.ndim == 2 and raw_prediction.shape[1] == 1:\n raw_prediction = raw_prediction.squeeze(1)\n proba = np.empty((raw_prediction.shape[0], 2), dtype=raw_prediction.dtype)\n proba[:, 1] = self.link.inverse(raw_prediction)\n proba[:, 0] = 1 - proba[:, 1]\n return proba", "def test_common_check_as_frame(name, dataset_func):\n bunch = dataset_func()\n check_as_frame(bunch, dataset_func)", " def __sklearn_tags__(self):\n tags = super().__sklearn_tags__()\n tags.input_tags.allow_nan = True\n tags.input_tags.sparse = True\n return tags" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Ctrl+K