You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"No variables using 'ToSelectFrom' found in the inputs. \
122
-
Please include at least one variable containing a list to select from."
121
+
"No variables using 'ToSelectFrom' found in the inputs. Please include at least one variable containing a list to select from."# noqa: E501
123
122
)
124
123
125
124
based_on= {
@@ -229,6 +228,9 @@ def save(self) -> None:
229
228
230
229
231
230
classEmbedder(Generic[TEvent], ABC):
231
+
def__init__(self, *args: Any, **kwargs: Any):
232
+
pass
233
+
232
234
@abstractmethod
233
235
defformat(self, event: TEvent) ->str:
234
236
...
@@ -300,9 +302,7 @@ def score_response(
300
302
returnresp
301
303
exceptExceptionase:
302
304
raiseRuntimeError(
303
-
f"The auto selection scorer did not manage to score the response, \
304
-
there is always the option to try again or tweak the reward prompt.\
305
-
Error: {e}"
305
+
f"The auto selection scorer did not manage to score the response, there is always the option to try again or tweak the reward prompt. Error: {e}"# noqa: E501
306
306
)
307
307
308
308
@@ -316,7 +316,7 @@ class RLChain(Chain, Generic[TEvent]):
316
316
- selection_scorer (Union[SelectionScorer, None]): Scorer for the selection. Can be set to None.
317
317
- policy (Optional[Policy]): The policy used by the chain to learn to populate a dynamic prompt.
318
318
- auto_embed (bool): Determines if embedding should be automatic. Default is False.
319
-
- metrics (Optional[MetricsTracker]): Tracker for metrics, can be set to None.
319
+
- metrics (Optional[Union[MetricsTrackerRollingWindow, MetricsTrackerAverage]]): Tracker for metrics, can be set to None.
320
320
321
321
Initialization Attributes:
322
322
- feature_embedder (Embedder): Embedder used for the `BasedOn` and `ToSelectFrom` inputs.
@@ -325,7 +325,8 @@ class RLChain(Chain, Generic[TEvent]):
325
325
- vw_cmd (List[str], optional): Command line arguments for the VW model.
326
326
- policy (Type[VwPolicy]): Policy used by the chain.
327
327
- vw_logs (Optional[Union[str, os.PathLike]]): Path for the VW logs.
328
-
- metrics_step (int): Step for the metrics tracker. Default is -1.
328
+
- metrics_step (int): Step for the metrics tracker. Default is -1. If set without metrics_window_size, average metrics will be tracked, otherwise rolling window metrics will be tracked.
329
+
- metrics_window_size (int): Window size for the metrics tracker. Default is -1. If set, rolling window metrics will be tracked.
329
330
330
331
Notes:
331
332
The class initializes the VW model using the provided arguments. If `selection_scorer` is not provided, a warning is logged, indicating that no reinforcement learning will occur unless the `update_with_delayed_score` method is called.
f"The rl chain does not accept '{self.selected_input_key}' \
462
-
or '{self.selected_based_on_input_key}' as input keys, \
463
-
they are reserved for internal use during auto reward."
461
+
f"The rl chain does not accept '{self.selected_input_key}' or '{self.selected_based_on_input_key}' as input keys, they are reserved for internal use during auto reward."# noqa: E501
"No variables using 'ToSelectFrom' found in the inputs. \
185
-
Please include at least one variable containing \
186
-
a list to select from."
302
+
"No variables using 'ToSelectFrom' found in the inputs. Please include at least one variable containing a list to select from."# noqa E501
187
303
)
188
304
189
305
iflen(list(actions.values())) >1:
190
306
raiseValueError(
191
-
"Only one variable using 'ToSelectFrom' can be provided in the inputs \
192
-
for the PickBest chain. Please provide only one variable \
193
-
containing a list to select from."
307
+
"Only one variable using 'ToSelectFrom' can be provided in the inputs for the PickBest chain. Please provide only one variable containing a list to select from."# noqa E501
194
308
)
195
309
196
310
ifnotcontext:
197
311
raiseValueError(
198
-
"No variables using 'BasedOn' found in the inputs. \
199
-
Please include at least one variable containing information \
200
-
to base the selected of ToSelectFrom on."
312
+
"No variables using 'BasedOn' found in the inputs. Please include at least one variable containing information to base the selected of ToSelectFrom on."# noqa E501
0 commit comments