3838class Workspace :
3939 def __init__ (
4040 self ,
41- args : List [str ],
41+ args : List [str ] = [] ,
4242 * ,
4343 model_data : Optional [bytes ] = None ,
4444 record_feature_names : bool = False ,
@@ -59,7 +59,7 @@ def __init__(
5959 >>> from vowpal_wabbit_next import Workspace
6060 >>> with open("model.bin", "rb") as f:
6161 ... model_data = f.read()
62- >>> workspace = Workspace([], model_data=model_data)
62+ >>> workspace = Workspace(model_data=model_data)
6363
6464 Create a workspace for training a contextual bandit with action dependent features model:
6565
@@ -72,7 +72,7 @@ def __init__(
7272 >>> import logging
7373 >>> logging.basicConfig(level=logging.INFO)
7474 >>> logging.getLogger("vowpal_wabbit_next.log").setLevel("INFO")
75- >>> workspace = Workspace([] )
75+ >>> workspace = Workspace()
7676
7777 Args:
7878 args (List[str]): VowpalWabbit command line options for configuring the model. An overall list can be found `here <https://vowpalwabbit.org/docs/vowpal_wabbit/python/latest/command_line_args.html>`_. Options which affect the driver are not supported. For example:
@@ -110,7 +110,7 @@ def predict_one(self, example: typing.Union[Example, List[Example]]) -> Predicti
110110
111111 Examples:
112112 >>> from vowpal_wabbit_next import Workspace, TextFormatParser
113- >>> workspace = Workspace([] )
113+ >>> workspace = Workspace()
114114 >>> parser = TextFormatParser(workspace)
115115 >>> workspace.learn_one(parser.parse_line("1.0 | price:.18 sqft:.15 age:.35 1976"))
116116 >>> workspace.predict_one(parser.parse_line("| price:.53 sqft:.32 age:.87 1924"))
@@ -134,7 +134,7 @@ def learn_one(self, example: typing.Union[Example, List[Example]]) -> None:
134134
135135 Examples:
136136 >>> from vowpal_wabbit_next import Workspace, TextFormatParser
137- >>> workspace = Workspace([] )
137+ >>> workspace = Workspace()
138138 >>> parser = TextFormatParser(workspace)
139139 >>> workspace.learn_one(parser.parse_line("1.0 | price:.18 sqft:.15 age:.35 1976"))
140140 >>> workspace.predict_one(parser.parse_line("| price:.53 sqft:.32 age:.87 1924"))
@@ -157,7 +157,7 @@ def predict_then_learn_one(
157157
158158 Examples:
159159 >>> from vowpal_wabbit_next import Workspace, TextFormatParser
160- >>> workspace = Workspace([] )
160+ >>> workspace = Workspace()
161161 >>> parser = TextFormatParser(workspace)
162162 >>> workspace.predict_then_learn_one(parser.parse_line("1.0 | price:.18 sqft:.15 age:.35 1976"))
163163 0.0
@@ -244,7 +244,7 @@ def weights(self) -> npt.NDArray[np.float32]:
244244
245245 Examples:
246246 >>> from vowpal_wabbit_next import Workspace
247- >>> model = Workspace([] )
247+ >>> model = Workspace()
248248 >>> print(model.weights().shape)
249249 (262144, 1, 4)
250250
@@ -309,7 +309,7 @@ def get_index_for_scalar_feature(
309309
310310 Examples:
311311 >>> from vowpal_wabbit_next import Workspace
312- >>> model = Workspace([] )
312+ >>> model = Workspace()
313313 >>> # Feature which looks like "|test thing" in text format
314314 >>> model.get_index_for_scalar_feature("thing", namespace_name="test")
315315 148099
0 commit comments