(
ctx,
model_a: str,
model_b: str,
dataset_path: str,
eval_dataset: str,
embedding_provider: str,
prompt_embedding_cache: Optional[str],
max_depth: int,
max_features: Union[float, str],
n_estimators: int,
save_dir: str,
model_id: str,
model_org: str,
)
| 36 | |
| 37 | @click.pass_context |
| 38 | def rorf_classifier( |
| 39 | ctx, |
| 40 | model_a: str, |
| 41 | model_b: str, |
| 42 | dataset_path: str, |
| 43 | eval_dataset: str, |
| 44 | embedding_provider: str, |
| 45 | prompt_embedding_cache: Optional[str], |
| 46 | max_depth: int, |
| 47 | max_features: Union[float, str], |
| 48 | n_estimators: int, |
| 49 | save_dir: str, |
| 50 | model_id: str, |
| 51 | model_org: str, |
| 52 | ): |
| 53 | from rorf.router.rorf import RoRFTrainer |
| 54 | |
| 55 | llms = [model_a, model_b] |
| 56 | |
| 57 | configs = { |
| 58 | "trainer": "RoRF", |
| 59 | "llms": llms, |
| 60 | "dataset_path": dataset_path, |
| 61 | "eval_dataset": eval_dataset, |
| 62 | "embedding_provider": embedding_provider, |
| 63 | "prompt_embedding_cache": prompt_embedding_cache, |
| 64 | "max_depth": max_depth, |
| 65 | "max_features": max_features, |
| 66 | "n_estimators": n_estimators, |
| 67 | "save_dir": save_dir, |
| 68 | "model_id": model_id, |
| 69 | "model_org": model_org, |
| 70 | } |
| 71 | |
| 72 | trainer_obj = RoRFTrainer( |
| 73 | llms=llms, |
| 74 | dataset_path=dataset_path, |
| 75 | eval_dataset=eval_dataset, |
| 76 | embedding_provider=embedding_provider, |
| 77 | prompt_embedding_cache=prompt_embedding_cache, |
| 78 | max_depth=max_depth, |
| 79 | max_features=max_features, |
| 80 | n_estimators=n_estimators, |
| 81 | save_dir=save_dir, |
| 82 | model_id=model_id, |
| 83 | model_org=model_org, |
| 84 | ) |
| 85 | write_config_to_json(configs, trainer_obj.save_path) |
| 86 | ctx.obj["trainer"] = trainer_obj |
| 87 | ctx.obj["configs"] = configs |
| 88 | |
| 89 | |
| 90 | @run.result_callback() |
nothing calls this directly
no test coverage detected