Skip to content

Commit

Permalink
pydoc
Browse files Browse the repository at this point in the history
  • Loading branch information
riteshghorse committed Jul 18, 2023
1 parent f7e974c commit 467e5dd
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions sdks/python/apache_beam/ml/inference/huggingface_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ def __init__(
max_batch_size: Optional[int] = None,
large_model: bool = False,
**kwargs):
"""Implementation of the abstract base class of ModelHandler interface
"""
Implementation of the abstract base class of ModelHandler interface
for Hugging Face. This class shouldn't be instantiated directly.
Use HuggingFaceModelHandlerKeyedTensor or HuggingFaceModelHandlerTensor.
Expand Down Expand Up @@ -257,7 +258,8 @@ class HuggingFaceModelHandlerKeyedTensor(
HuggingFaceModelHandler[Dict[str, Union[tf.Tensor, torch.Tensor]],
PredictionResult,
Union[AutoModel, TFAutoModel]]):
"""Implementation of the ModelHandler interface for HuggingFace with
"""
Implementation of the ModelHandler interface for HuggingFace with
Keyed Tensors for PyTorch/Tensorflow backend.
Depending on the type of tensors, the model framework is determined
Expand All @@ -275,7 +277,8 @@ def run_inference(
model: Union[AutoModel, TFAutoModel],
inference_args: Optional[Dict[str, Any]] = None
) -> Iterable[PredictionResult]:
"""Runs inferences on a batch of Keyed Tensors and returns an Iterable of
"""
Runs inferences on a batch of Keyed Tensors and returns an Iterable of
Tensors Predictions.
This method stacks the list of Tensors in a vectorized format to optimize
Expand Down Expand Up @@ -356,7 +359,8 @@ class HuggingFaceModelHandlerTensor(HuggingFaceModelHandler[Union[tf.Tensor,
Union[AutoModel,
TFAutoModel]]
):
"""Implementation of the ModelHandler interface for HuggingFace with
"""
Implementation of the ModelHandler interface for HuggingFace with
Tensors for PyTorch/Tensorflow backend.
Depending on the type of tensors, the model framework is determined
Expand All @@ -374,7 +378,8 @@ def run_inference(
model: Union[AutoModel, TFAutoModel],
inference_args: Optional[Dict[str, Any]] = None
) -> Iterable[PredictionResult]:
"""Runs inferences on a batch of Tensors and returns an Iterable of
"""
Runs inferences on a batch of Tensors and returns an Iterable of
Tensors Predictions.
This method stacks the list of Tensors in a vectorized format to optimize
Expand Down

0 comments on commit 467e5dd

Please sign in to comment.