MCPcopy Create free account

hub / github.com/Not-Diamond/RoRF / functions

Functions34 in github.com/Not-Diamond/RoRF

↓ 4 callersMethod_save
Save an object to the specified path.
rorf/router/rorf.py:203
↓ 3 callersMethodget_prompt_embeddings
(self, prompts: List[str])
rorf/router/embeddings.py:24
↓ 3 callersMethodpredict_proba
Given a prompt or prompt embedding, return the model recommended by the RoRF router along with the probabilities of the two models.
rorf/controller.py:88
↓ 2 callersMethodget_dataset
(self)
rorf/router/dataloader.py:16
↓ 2 callersFunctionget_embedding_model
Get an embedding model based on the embedding provider.
rorf/router/utils.py:6
↓ 2 callersMethodget_features
Get pairwise dataset with a single target label after comparing model responses
rorf/router/dataloader.py:44
↓ 2 callersMethodget_prompt_embeddings_dataset
Compute prompt embeddings for the given prompts.
rorf/router/rorf.py:67
↓ 2 callersMethodload
Load the RoRF router and embedding model from the specified local or Huggingface repo.
rorf/controller.py:106
↓ 2 callersMethodpush_to_hub
Push the trained model and its configuration to the Huggingface Hub.
rorf/router/rorf.py:229
↓ 1 callersMethod_load
Load an object from the specified path.
rorf/router/rorf.py:217
↓ 1 callersMethod_parse_model_name
Parse the method and embedding model provider's name from the router name.
rorf/controller.py:55
↓ 1 callersMethod_train
Train and evaluate a RandomForestClassifier on the training set.
rorf/router/rorf.py:101
↓ 1 callersMethod_train_rf_classifier
Train a RandomForestClassifier on the given features and labels.
rorf/router/rorf.py:84
↓ 1 callersMethod_trim_gpt_message
Return the number of tokens used by a message.
rorf/router/embeddings.py:66
↓ 1 callersMethod_validate_router_threshold
Validate the router and threshold.
rorf/controller.py:42
↓ 1 callersMethodbatch_calculate_win_rate
Given a list of prompts, calculate the win rates (Model A probability) using the RoRF router.
rorf/controller.py:68
↓ 1 callersMethodevaluate
Evaluate the RandomForestClassifier on the evaluation/test set.
rorf/router/rorf.py:128
↓ 1 callersFunctionrun
(ctx)
trainer.py:19
↓ 1 callersMethodtrain
(self, *args, **kwargs)
rorf/router/rorf.py:24
↓ 1 callersFunctionwrite_config_to_json
Write the configuration to a JSON file.
rorf/router/utils.py:19
Method__init__
Initialize the RoRF controller with the specified router, model A, model B, and threshold. Threshold determines the percentage of cal
rorf/controller.py:24
Method__init__
(self, dataset_path: Path, llms: List[str], eval_dataset: Optional[List[str]] = None)
rorf/router/dataloader.py:21
Method__init__
( self, llms: List, dataset_path: str, eval_dataset: str, embedding_pr
rorf/router/rorf.py:29
Method__init__
Initialize a Voyage AI client.
rorf/router/embeddings.py:29
Method__init__
Initialize an OpenAI client.
rorf/router/embeddings.py:58
Method__init__
Initialize a Jina model locally.
rorf/router/embeddings.py:108
Methodget_dataset
(self, split)
rorf/router/dataloader.py:26
Methodget_prompt_embeddings
Get embeddings from Voyage AI for a list of prompts.
rorf/router/embeddings.py:37
Methodget_prompt_embeddings
Get embeddings from OpenAI for a list of prompts.
rorf/router/embeddings.py:80
Methodget_prompt_embeddings
Get embeddings from a local Jina AI embedding model for a list of prompts.
rorf/router/embeddings.py:120
Functionprocess_result
(ctx, result, **kwargs)
trainer.py:92
Functionrorf_classifier
( ctx, model_a: str, model_b: str, dataset_path: str, eval_dataset: str, embedding_pro
trainer.py:38
Methodroute
Given a prompt or prompt embedding, return the model recommended by the RoRF router.
rorf/controller.py:81
Methodtrain
Train a RandomForestClassifier on the training set and evaluate on the evaluation/test set.
rorf/router/rorf.py:116