diff --git a/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py b/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py index 54586516a7a..6993919dea2 100644 --- a/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py +++ b/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py @@ -422,22 +422,10 @@ class name in this argument. ) # Add metrics collector to the Katib Experiment. - # Up to now, we only support parameter `kind`, of which default value is - # `StdOut`, to specify the kind of metrics collector. + # Up to now, we only support parameter `kind`, of which default value + # is `StdOut`, to specify the kind of metrics collector. experiment.spec.metrics_collector_spec = models.V1beta1MetricsCollectorSpec( - collector=models.V1beta1CollectorSpec( - kind=metrics_collector_config["kind"] - ), - source=models.V1beta1SourceSpec( - filter=models.V1beta1FilterSpec( - metrics_format=[ - # For example: train_loss=0.846 - r"([\w|-]+)\s*=\s*([+-]?\d*(\.\d+)?([Ee][+-]?\d+)?)", - # For example: 'train_loss':0.846 - r"'([\w|-]+)'\s*:\s*([+-]?\d*(\.\d+)?([Ee][+-]?\d+)?)", - ] - ) - ), + collector=models.V1beta1CollectorSpec(kind=metrics_collector_config["kind"]) ) # Create Container and Pod specifications. @@ -515,10 +503,20 @@ class name in this argument. ) except ImportError: raise ImportError( - "Tune API dependencies not installed. " + "LLM dependencies for Tune API are not installed. " + "Run: pip install -U 'kubeflow-katib[huggingface]' " ) + # Add metrics format for the metrics collector. + experiment.spec.metrics_collector_spec.source=models.V1beta1SourceSpec( + filter=models.V1beta1FilterSpec( + metrics_format=[ + # For example: 'train_loss':0.846 + r"'([\w|-]+)'\s*:\s*([+-]?\d*(\.\d+)?([Ee][+-]?\d+)?)", + ] + ) + ) + # Create PVC for the Storage Initializer. # TODO (helenxie-bit): PVC Creation should be part of Katib Controller. try: