1from sentence_transformers import SentenceTransformer
23# Download from the 🤗 Hub4model = SentenceTransformer("ronit01/rag_tuned_minilm_100")5# Run inference6sentences =[7'What three vector store backends does RapidFire AI support and what modes of operation do they offer?',8'RapidFire AI also supports external persistent vector stores beyond the default in-memory FAISS.\nThis allows you to scale to larger corpora, persist indexes across runs and experiments, and leverage managed vector DBMS services.\nAs of this writing, **Pinecone** (hosted serverless or pod-based) and **PostgreSQL PGVector** (self-hosted or managed) are supported.\n\nEach external store supports three modes of operation:\n\n- **Create mode:** Build a new index from base documents from within RapidFire AI itself and use it for RAG.\n- **Read mode:** Retrieve from a pre-existing index and use it for RAG. \n- **Update mode:** Add new content to an existing index from additional base documents from within RapidFire AI itself and use it for RAG. \n\nSee the :doc:`API: LangChain RAG Spec page</ragspecs>` for more details on how to specify these external vector stores.',9'.. py:function:: __init__(self, experiment_name: str, mode: str = "fit", experiments_path: str = "./rapidfire_experiments") -> None\n\n\t:param experiment_name: Unique name for this experiment\n\t:type experiment_name: str\n\t\n\t:param mode: Mode of this experiment, either :code:`"fit"` or :code:`"eval"`; default is :code:`"fit"`\n\t:type mode: str\n\t\n\t:param experiments_path: Path to a folder to store this experiment\'s artifacts. Default is ``"./rapidfire_experiments"``)\n\t:type experiments_path: str, optional \n\n\t:return: None\n\t:rtype: None',10]11embeddings = model.encode(sentences)12print(embeddings.shape)13# [3, 384]1415# Get the similarity scores for the embeddings16similarities = model.similarity(embeddings, embeddings)17print(similarities)18# tensor([[1.0000, 0.9882, 0.2547],19# [0.9882, 1.0000, 0.2603],20# [0.2547, 0.2603, 1.0000]])
Training Details
Training Dataset
Unnamed Dataset
Size: 208 training samples
Columns: sentence_0, sentence_1, and label
Approximate statistics based on the first 208 samples:
sentence_0
sentence_1
label
type
string
string
float
details
min: 11 tokens
mean: 24.87 tokens
max: 34 tokens
min: 31 tokens
mean: 218.51 tokens
max: 256 tokens
min: 0.0
mean: 0.25
max: 1.0
Samples:
sentence_0
sentence_1
label
What arguments does the RFModelConfig class accept for defining a model configuration in RapidFire AI?
:param search_cfg: The search algorithm type and its kwargs to use for retrieval of vectors/chunks, provided as a single dictionary. Must include a key :code:[object Object] with one of the following three options listed as value; default is :code:[object Object].
* :code:`"similarity"`: Standard cosine similarity search.
* :code:`"similarity_score_threshold"`: Similarity search with minimum score threshold (SST).
* :code:`"mmr"`: Maximum Marginal Relevance (MMR) search for diversity.
Additional parameters for search configuration depend on the type; the keys can include the following:
* :code:`"k"`: Number of documents to retrieve. Default is 5.
* :code:`"filter"`: Optional filter criteria function for search results.
* :code:`"score_threshold"`: Only for SST. Minimum similarity score threshold.
* :code:`"fetch_k"`: Only for MMR. Number of documents to fetch before MMR reranking. Default is 20.
* :code:`"lambda_mult"`: Only for MMR...</code> | <code>0.0</code> |
| How do reward functions work in RapidFire AI for GRPO training, and what arguments does TRL inject into them? | RapidFire AI supports both self-hosted open LLMs and closed model LLM APIs as the generator. [object Object]As of this writing, it wraps around the model config of vLLM for the former and the OpenAI API for the latter. [object Object]We plan to expand support for more generator plugins, including Gemini and Claude APIs, based on feedback. [object Object][object Object][object Object]RFvLLMModelConfig[object Object]------[object Object][object Object]This is a wrapper around vLLM's :class:[object Object] and :class:[object Object] classes. [object Object]The full list of their arguments are available on [object Object]__ [object Object]and [object Object]__, respectively.[object Object][object Object]The difference here is that the individual arguments (knobs) can be :class:[object Object] valued or [object Object]:class:[object Object] valued in an :class:[object Object]. [object Object]That is how you can specify a base set of knob combinations from which a config group can [object Object]be produced. Also read :doc:[object Object]. | 0.0 |
| What are the three use case tutorials provided for RAG and context engineering, and what type of workflow does each demonstrate? | This use case notebook features an all-closed model API workflow, with Open AI calls used for both embedding for generation. So, you do not need a GPU to run this notebook. | 1.0 |
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}
ContrastiveLoss
bibtex
1@inproceedings{hadsell2006dimensionality,
2 author={Hadsell, R. and Chopra, S. and LeCun, Y.},
3 booktitle={2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06)},
4 title={Dimensionality Reduction by Learning an Invariant Mapping},
5 year={2006},
6 volume={2},
7 number={},
8 pages={1735-1742},
9 doi={10.1109/CVPR.2006.100}
10}