Sentence Similarity
sentence-transformers
Safetensors
bert
feature-extraction
Generated from Trainer
dataset_size:208
loss:ContrastiveLoss
text-embeddings-inference
Instructions to use ronit01/rag_tuned_minilm_10 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use ronit01/rag_tuned_minilm_10 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("ronit01/rag_tuned_minilm_10") sentences = [ "How does RFDPOConfig differ from RFGRPOConfig in the trainer configuration?", " :param document_template: Optional function to format each retrieved chunk for context injection into prompts. Should accept a single LangChain :class:`Document` object and return a formatted string. Multiple documents are separated by double newlines when serialized. If not provided, the following default template is used:\n \n .. code-block:: python\n \n def default_template(doc: Document) -> str:\n \"\"\"Default document formatting template.\"\"\"\n metadata = \"; \".join([f\"{k}: {v}\" for k, v in doc.metadata.items()])\n return f\"{metadata}:\\n{doc.page_content}\"\n \n You can provide a custom template to control what metadata fields are included and how the content is formatted. For example, to include only a specific metadata field:\n \n .. code-block:: python\n \n def sample_template(doc: Document) -> str:\n doc_source = doc.metadata.get(\"source\", \"\")\n return f\"Document Source: {doc_source}:\\nContent: {doc.page_content}\"\n \n Or for a dataset like SciFact where documents have a :code:`\"title\"` metadata field ingested via :code:`metadata_func` in the document loader:\n \n .. code-block:: python\n \n def custom_template(doc: Document) -> str:\n return f\"{doc.metadata['title']}: {doc.page_content}\"\n \n :type document_template: Callable[[Document], str], optional", "Recovering Storage Space\n-------\n\nIf you run out of storage space on your machine due to experimenting with lots of LLMs, we \nrecommend clearing out the \".cache\" folder on your home directory that is created by \nHugging Face to import the base models. \nOne experiment's imported models are not needed for another; so, it is safe to delete them.\n\nIf you want to reclaim even more space, look at the artifacts from your experiments and \neither delete some of the files or move them to other/remote storage. \nNote that when you use LoRA adapters, RapidFire AI saves only the trained adapters in the \ncheckpoints of the runs, not the base models.", ".. py:function:: get_runs_info(self) -> pd.DataFrame:\n\n\t:return: A DataFrame with the following columns: run_id, status, mlflow_run_id, completed_steps, total_steps, start_chunk_id, num_chunks_visited_curr_epoch, num_epochs_completed, error, source, ended_by, warm_started_from, config (full config dictionary)\n\n\t:rtype: pandas.DataFrame" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Ctrl+K