riteshghorse commented on code in PR #28474:
URL: https://github.com/apache/beam/pull/28474#discussion_r1330668405
##########
sdks/python/apache_beam/ml/inference/huggingface_inference.py:
##########
@@ -593,9 +594,18 @@ def __init__(
Args:
task (str or enum.Enum): task supported by HuggingFace Pipelines.
Accepts a string task or an enum.Enum from PipelineTask.
- model : path to pretrained model on Hugging Face Models Hub to use custom
- model for the chosen task. If the model already defines the task then
- no need to specify the task parameter.
+ model (str): path to the pretrained *model-id* on Hugging Face Models Hub
+ to use custom model for the chosen task. If the `model` already defines
+ the task then no need to specify the `task` parameter.
+ Use the *model-id* string instead of an actual model here.
+ Model-specific kwargs for `from_pretrained(..., **model_kwargs)` can be
+ specified with `model_kwargs` using `load_pipeline_args`.
+
+ Example Usage::
+ model_handler = HuggingFacePipelineModelHandler(
+ model_uri="bert-base-uncased", model="meta-llama/Llama-2-7b-hf",
Review Comment:
my bad.. copied the wrong example. it should have been task and model
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]