INNER CODE UNIT · Python

_csv_callback

neuralmagic/sparsezoo · src/sparsezoo/deployment_package/cli.py:87

def _csv_callback(ctx, self, value):
    """
    A click callback function to parse a comma separated string with metrics
    into a list
    """
    current_metrics = []
    for metric in value.split(","):
        metric_ = metric.lower().strip()
        if metric_ not in METRICS:
            raise ValueError(f"Specified metric {metric_} is not supported")
        current_metrics.append(metric_)
    return current_metrics


def _download_deployment_directory(stub: str, destination: Optional[str] = None) -> str:
    model = Model(stub)
    model.deployment.download(destination_path=destination)
    return model.deployment.path

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…