|
33 | 33 | _TEST_MODEL_FULL_RESOURCE_NAME = (
|
34 | 34 | "publishers/google/models/paligemma@paligemma-224-float32"
|
35 | 35 | )
|
| 36 | +_TEST_HUGGING_FACE_MODEL_FULL_RESOURCE_NAME = ( |
| 37 | + "publishers/meta-llama/models/llama-3.3-70b-instruct" |
| 38 | +) |
36 | 39 | _TEST_PUBLISHER_MODEL_NAME = "publishers/google/models/paligemma"
|
37 | 40 | _TEST_HUGGING_FACE_PUBLISHER_MODEL_NAME = "publishers/hf-google/models/gemma-2-2b"
|
38 | 41 | _TEST_MODEL_SIMPLIFIED_RESOURCE_NAME = "google/paligemma@paligemma-224-float32"
|
39 | 42 | _TEST_MODEL_HUGGING_FACE_ID = "meta-llama/Llama-3.3-70B-Instruct"
|
| 43 | +_TEST_MODEL_HUGGING_FACE_RESOURCE_NAME = ( |
| 44 | + "publishers/hf-meta-llama/models/llama-3.3-70b-instruct" |
| 45 | +) |
40 | 46 | # Note: The full resource name is in lower case.
|
41 | 47 | _TEST_MODEL_HUGGING_FACE_FULL_RESOURCE_NAME = (
|
42 | 48 | "publishers/hf-meta-llama/models/llama-3.3-70b-instruct@001"
|
@@ -120,6 +126,24 @@ def get_publisher_model_mock():
|
120 | 126 | )
|
121 | 127 | ),
|
122 | 128 | ),
|
| 129 | + types.PublisherModel( |
| 130 | + name=_TEST_MODEL_HUGGING_FACE_RESOURCE_NAME, |
| 131 | + supported_actions=types.PublisherModel.CallToAction( |
| 132 | + multi_deploy_vertex=types.PublisherModel.CallToAction.DeployVertex( |
| 133 | + multi_deploy_vertex=[ |
| 134 | + types.PublisherModel.CallToAction.Deploy( |
| 135 | + dedicated_resources=types.DedicatedResources( |
| 136 | + machine_spec=types.MachineSpec( |
| 137 | + machine_type="g2-standard-16", |
| 138 | + accelerator_type="NVIDIA_L4", |
| 139 | + accelerator_count=1, |
| 140 | + ) |
| 141 | + ) |
| 142 | + ) |
| 143 | + ] |
| 144 | + ) |
| 145 | + ), |
| 146 | + ), |
123 | 147 | ]
|
124 | 148 | yield get_publisher_model_mock
|
125 | 149 |
|
@@ -758,6 +782,16 @@ def test_list_deploy_options(self, get_publisher_model_mock):
|
758 | 782 | )
|
759 | 783 | )
|
760 | 784 |
|
| 785 | + hf_model = model_garden.OpenModel(_TEST_MODEL_HUGGING_FACE_ID) |
| 786 | + hf_model.list_deploy_options() |
| 787 | + get_publisher_model_mock.assert_called_with( |
| 788 | + types.GetPublisherModelRequest( |
| 789 | + name=_TEST_HUGGING_FACE_MODEL_FULL_RESOURCE_NAME, |
| 790 | + is_hugging_face_model=True, |
| 791 | + include_equivalent_model_garden_model_deployment_configs=True, |
| 792 | + ) |
| 793 | + ) |
| 794 | + |
761 | 795 | def test_list_deployable_models(self, list_publisher_models_mock):
|
762 | 796 | """Tests getting the supported deploy options for a model."""
|
763 | 797 | aiplatform.init(
|
|
0 commit comments