Skip to content

Deployment

DeploymentStep

Bases: PipelineStep

Pipeline step for deploying a model using FastAPI and ONNX Runtime.

Source code in textforge/deployment.py
class DeploymentStep(PipelineStep):
    """Pipeline step for deploying a model using FastAPI and ONNX Runtime."""

    def __init__(self):
        """Initialize DeploymentStep."""
        super().__init__()

    def run(self, model_path, quantize: bool = False):
        """Run the deployment process.

        Args:
            model_path (str): Path to the model directory.
            quantize (bool, optional): Flag to indicate whether to quantize the model. Defaults to False.
        """
        serve(model_path, quantize)

    def save(self):
        """Save deployment configuration or artifacts.

        Note:
            This method is currently a placeholder.
        """
        pass

__init__()

Initialize DeploymentStep.

Source code in textforge/deployment.py
def __init__(self):
    """Initialize DeploymentStep."""
    super().__init__()

run(model_path, quantize=False)

Run the deployment process.

Parameters:

Name Type Description Default
model_path str

Path to the model directory.

required
quantize bool

Flag to indicate whether to quantize the model. Defaults to False.

False
Source code in textforge/deployment.py
def run(self, model_path, quantize: bool = False):
    """Run the deployment process.

    Args:
        model_path (str): Path to the model directory.
        quantize (bool, optional): Flag to indicate whether to quantize the model. Defaults to False.
    """
    serve(model_path, quantize)

save()

Save deployment configuration or artifacts.

Note

This method is currently a placeholder.

Source code in textforge/deployment.py
def save(self):
    """Save deployment configuration or artifacts.

    Note:
        This method is currently a placeholder.
    """
    pass