Improve appearance of selection menus
This commit is contained in:
+7
-4
@@ -27,7 +27,7 @@ from optuna.exceptions import ExperimentalWarning
|
|||||||
from optuna.samplers import TPESampler
|
from optuna.samplers import TPESampler
|
||||||
from optuna.study import StudyDirection
|
from optuna.study import StudyDirection
|
||||||
from pydantic import ValidationError
|
from pydantic import ValidationError
|
||||||
from questionary import Choice
|
from questionary import Choice, Style
|
||||||
from rich.traceback import install
|
from rich.traceback import install
|
||||||
|
|
||||||
from .config import Settings
|
from .config import Settings
|
||||||
@@ -315,9 +315,9 @@ def run():
|
|||||||
choices = [
|
choices = [
|
||||||
Choice(
|
Choice(
|
||||||
title=(
|
title=(
|
||||||
f"Trial {trial.user_attrs['index']:>3}: "
|
f"[Trial {trial.user_attrs['index']:>3}] "
|
||||||
f"Refusals {trial.user_attrs['refusals']:>2}/{len(evaluator.bad_prompts)}, "
|
f"Refusals: {trial.user_attrs['refusals']:>2}/{len(evaluator.bad_prompts)}, "
|
||||||
f"KL divergence {trial.user_attrs['kl_divergence']:.2f}"
|
f"KL divergence: {trial.user_attrs['kl_divergence']:.2f}"
|
||||||
),
|
),
|
||||||
value=trial,
|
value=trial,
|
||||||
)
|
)
|
||||||
@@ -348,6 +348,7 @@ def run():
|
|||||||
trial = questionary.select(
|
trial = questionary.select(
|
||||||
"Which trial do you want to use?",
|
"Which trial do you want to use?",
|
||||||
choices=choices,
|
choices=choices,
|
||||||
|
style=Style([("highlighted", "reverse")]),
|
||||||
).ask()
|
).ask()
|
||||||
|
|
||||||
if trial is None or trial == "":
|
if trial is None or trial == "":
|
||||||
@@ -374,6 +375,7 @@ def run():
|
|||||||
"Chat with the model",
|
"Chat with the model",
|
||||||
"Nothing (return to trial selection menu)",
|
"Nothing (return to trial selection menu)",
|
||||||
],
|
],
|
||||||
|
style=Style([("highlighted", "reverse")]),
|
||||||
).ask()
|
).ask()
|
||||||
|
|
||||||
if action is None or action == "Nothing (return to trial selection menu)":
|
if action is None or action == "Nothing (return to trial selection menu)":
|
||||||
@@ -422,6 +424,7 @@ def run():
|
|||||||
"Public",
|
"Public",
|
||||||
"Private",
|
"Private",
|
||||||
],
|
],
|
||||||
|
style=Style([("highlighted", "reverse")]),
|
||||||
).ask()
|
).ask()
|
||||||
private = visibility == "Private"
|
private = visibility == "Private"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user