Skip to content

Commit

Permalink
shorter param names
Browse files Browse the repository at this point in the history
  • Loading branch information
epinzur committed Jun 27, 2024
1 parent d6efb3b commit 21047c8
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions ragulate/cli_commands/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ def setup_query(subparsers):
)
query_parser.add_argument(
"-s",
"--script_path",
"--script",
type=str,
help="The path to the python script that contains the query method",
required=True,
)
query_parser.add_argument(
"-m",
"--method-name",
"--method",
type=str,
help="The name of the method in the script to run query",
required=True,
Expand Down Expand Up @@ -91,7 +91,7 @@ def setup_query(subparsers):
action="store_true",
)
query_parser.add_argument(
"--llm_provider",
"--provider",
type=str,
help=("The name of the LLM Provider to use for Evaluation."),
choices=[
Expand All @@ -102,27 +102,31 @@ def setup_query(subparsers):
"Langchain",
"Huggingface",
],
default="OpenAI",
)
query_parser.add_argument(
"--model_name",
"--model",
type=str,
help=("The name or id of the LLM model or deployment to use for Evaluation."),
help=(
"The name or id of the LLM model or deployment to use for Evaluation.",
"Generally used in combination with the --provider param.",
),
)
query_parser.set_defaults(func=lambda args: call_query(**vars(args)))

def call_query(
name: str,
script_path: str,
method_name: str,
script: str,
method: str,
var_name: List[str],
var_value: List[str],
dataset: List[str],
subset: List[str],
sample: float,
seed: int,
restart: bool,
llm_provider: str,
model_name: str,
provider: str,
model: str,
**kwargs,
):
if sample <= 0.0 or sample > 1.0:
Expand All @@ -144,14 +148,14 @@ def call_query(

query_pipeline = QueryPipeline(
recipe_name=name,
script_path=script_path,
method_name=method_name,
script_path=script,
method_name=method,
ingredients=ingredients,
datasets=datasets,
sample_percent=sample,
random_seed=seed,
restart_pipeline=restart,
llm_provider=llm_provider,
model_name=model_name,
llm_provider=provider,
model_name=model,
)
query_pipeline.query()

0 comments on commit 21047c8

Please sign in to comment.