Sentence Similarity
sentence-transformers
Safetensors
bert
feature-extraction
Generated from Trainer
dataset_size:208
loss:ContrastiveLoss
text-embeddings-inference
Instructions to use ronit01/final_golden_rag_tuned_minilm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use ronit01/final_golden_rag_tuned_minilm with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("ronit01/final_golden_rag_tuned_minilm") sentences = [ "How do the Stop and Delete IC Ops compare in terms of their effects on a run's state, visibility on the dashboard, resource usage, artifact preservation, and what further IC Ops can be performed on the run afterward?", "API: User-Provided Functions for Run Evals\n===============\n\nUsers can provide the following custom functions as part of their eval config to be used in :func:`run_evals()`.\nNote that each leaf config can have its own set of functions for all of these.\n\n\nPreprocess Function\n-------------------\n\nMandatory user-provided function to prepare the inputs to be given to the generator model. \nIt is invoked for each batch during the evaluation process before generation.\nPass it directly to the :code:`preprocess_fn` key in your eval config dictionary.\n\nThe system injects into this function the batch data, as well as the RAG spec and \nthe prompt manager of an individual leaf config.\n\n\n.. py:function:: preprocess_fn(batch: dict[str, list], rag: RFLangChainRagSpec, prompt_manager: RFPromptManager) -> dict[str, list]\n\n :param batch: Dictionary with a batch of examples with dataset field names as keys and lists as values", "Delete\n----\n\nThis IC Op earmarks the run to be deleted from the next chunk onward. \nOn the chart, you will see its curves vanish almost immediately. \nYou cannot do any further IC Ops on a deleted run because it will not be visible. \nNote that although a deleted run vanishes from the plots, its model checkpoints are still part of \nthe artifacts of that experiment so that you have post-hoc audibility.\n", "Formatting Function\n------\n\nOptional user-provided function to format each example (row) of the dataset to construct \nthe prompt and completion with relevant roles and system prompt as expected by your model. \nApart from adding the system prompt, for conversational data it should format the user \ninstruction and assistant responses as separate message dictionary entries.\n\nIt is passed to the :code:`formatting_func` argument of :class:`RFModelConfig`. \nAlso read: :doc:`the LoRA and Model Configs page</models>`.\nYou can create multiple variants of these functions and pass them all as a single \n:code:`List` to your :class:`RFModelConfig` to create a multi-config specification.\n\nThis function is invoked by the underlying HF trainer on all examples of the train dataset \nand (if given) eval dataset on the fly.\n\n\n.. py:function:: sample_formatting_fn(row: Dict[str, Any]) -> Dict[str, List[Dict[str, str]]]\n\n :param row: Dictionary containing a single data example with keys like \"instruction\" and \"response\"\n :type row: Dict[str, Any]\n\n :return: Dictionary with \"prompt\" and \"completion\" keys, each containing a list of chat messages with \"role\" and \"content\" fields\n :rtype: Dict[str, List[Dict[str, str]]]\n\n\n**Example:**\n\n.. code-block:: python\n\n\t# From the SFT tutorial notebook\n\tdef sample_formatting_function(row):\n\t\t\"\"\"Function to preprocess each row from dataset\"\"\"\n\t\t# Special tokens for formatting\n\t\tSYSTEM_PROMPT = \"You are a helpful and friendly customer support assistant. Please answer the user's query to the best of your ability.\"\n\t\treturn {\n\t\t\t\"prompt\": [\n\t\t\t\t{\"role\": \"system\", \"content\": SYSTEM_PROMPT},\n\t\t\t\t{\"role\": \"user\", \"content\": row[\"instruction\"]},\n\t\t\t],\n\t\t\t\"completion\": [\n\t\t\t\t{\"role\": \"assistant\", \"content\": row[\"response\"]}\n\t\t\t]\n\t\t}" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Ctrl+K