A programming framework for agentic AI
move import position (#102)
Chi Wang682cb49654f5
diff --git a/flaml/onlineml/trial.py b/flaml/onlineml/trial.pyindex e1f369130..0bf50df97 100644--- a/flaml/onlineml/trial.py+++ b/flaml/onlineml/trial.py@@ -270,8 +270,6 @@ class VowpalWabbitTrial(BaseOnlineTrial):- Namespace vs features:https://stackoverflow.com/questions/28586225/in-vowpal-wabbit-what-is-the-difference-between-a-namespace-and-feature"""- from vowpalwabbit import pyvw- MODEL_CLASS = pyvw.vwcost_unit = 1.0interactions_config_key = 'interactions'MIN_RES_CONST = 5@@ -299,6 +297,11 @@ class VowpalWabbitTrial(BaseOnlineTrial):trial_id (str): id of the trial (if None, it will be generated in the constructor)"""+ try:+ from vowpalwabbit import pyvw+ except ImportError:+ raise ImportError(+ 'To use AutoVW, please run pip install flaml[vw] to install vowpalwabbit')# attributesself.trial_id = self._config_to_id(config) if trial_id is None else trial_idlogger.info('Create trial with trial_id: %s', self.trial_id)@@ -306,7 +309,7 @@ class VowpalWabbitTrial(BaseOnlineTrial):custom_trial_name, self.trial_id)self.model = None # model is None until the config is scheduled to runself.result = None- self.trainable_class = self.MODEL_CLASS+ self.trainable_class = pyvw.vw# variables that are needed during online trainingself._metric = metricself._y_min_observed = Nonediff --git a/flaml/version.py b/flaml/version.pyindex 3d187266f..dd9b22ccc 100644--- a/flaml/version.py+++ b/flaml/version.py@@ -1 +1 @@-__version__ = "0.5.0"+__version__ = "0.5.1"