Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Not-Diamond/RoRF
/ functions
Functions
34 in github.com/Not-Diamond/RoRF
⨍
Functions
34
◇
Types & classes
10
↓ 4 callers
Method
_save
Save an object to the specified path.
rorf/router/rorf.py:203
↓ 3 callers
Method
get_prompt_embeddings
(self, prompts: List[str])
rorf/router/embeddings.py:24
↓ 3 callers
Method
predict_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 callers
Method
get_dataset
(self)
rorf/router/dataloader.py:16
↓ 2 callers
Function
get_embedding_model
Get an embedding model based on the embedding provider.
rorf/router/utils.py:6
↓ 2 callers
Method
get_features
Get pairwise dataset with a single target label after comparing model responses
rorf/router/dataloader.py:44
↓ 2 callers
Method
get_prompt_embeddings_dataset
Compute prompt embeddings for the given prompts.
rorf/router/rorf.py:67
↓ 2 callers
Method
load
Load the RoRF router and embedding model from the specified local or Huggingface repo.
rorf/controller.py:106
↓ 2 callers
Method
push_to_hub
Push the trained model and its configuration to the Huggingface Hub.
rorf/router/rorf.py:229
↓ 1 callers
Method
_load
Load an object from the specified path.
rorf/router/rorf.py:217
↓ 1 callers
Method
_parse_model_name
Parse the method and embedding model provider's name from the router name.
rorf/controller.py:55
↓ 1 callers
Method
_train
Train and evaluate a RandomForestClassifier on the training set.
rorf/router/rorf.py:101
↓ 1 callers
Method
_train_rf_classifier
Train a RandomForestClassifier on the given features and labels.
rorf/router/rorf.py:84
↓ 1 callers
Method
_trim_gpt_message
Return the number of tokens used by a message.
rorf/router/embeddings.py:66
↓ 1 callers
Method
_validate_router_threshold
Validate the router and threshold.
rorf/controller.py:42
↓ 1 callers
Method
batch_calculate_win_rate
Given a list of prompts, calculate the win rates (Model A probability) using the RoRF router.
rorf/controller.py:68
↓ 1 callers
Method
evaluate
Evaluate the RandomForestClassifier on the evaluation/test set.
rorf/router/rorf.py:128
↓ 1 callers
Function
run
(ctx)
trainer.py:19
↓ 1 callers
Method
train
(self, *args, **kwargs)
rorf/router/rorf.py:24
↓ 1 callers
Function
write_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
Method
get_dataset
(self, split)
rorf/router/dataloader.py:26
Method
get_prompt_embeddings
Get embeddings from Voyage AI for a list of prompts.
rorf/router/embeddings.py:37
Method
get_prompt_embeddings
Get embeddings from OpenAI for a list of prompts.
rorf/router/embeddings.py:80
Method
get_prompt_embeddings
Get embeddings from a local Jina AI embedding model for a list of prompts.
rorf/router/embeddings.py:120
Function
process_result
(ctx, result, **kwargs)
trainer.py:92
Function
rorf_classifier
( ctx, model_a: str, model_b: str, dataset_path: str, eval_dataset: str, embedding_pro
trainer.py:38
Method
route
Given a prompt or prompt embedding, return the model recommended by the RoRF router.
rorf/controller.py:81
Method
train
Train a RandomForestClassifier on the training set and evaluate on the evaluation/test set.
rorf/router/rorf.py:116