From ff1bf93cc3d835d14105c073494fb368d0c96ecb Mon Sep 17 00:00:00 2001 From: "Peter St. John" Date: Thu, 23 Jan 2025 20:58:14 +0000 Subject: [PATCH] add init to tests Signed-off-by: Peter St. John --- .../tests/bionemo/amplify/__init__.py | 14 ++++++++ .../tests/bionemo/amplify/test_model.py | 32 +++++++++++++++++++ .../tests/bionemo/esm2/data/__init__.py | 14 ++++++++ 3 files changed, 60 insertions(+) create mode 100644 sub-packages/bionemo-amplify/tests/bionemo/amplify/__init__.py create mode 100644 sub-packages/bionemo-amplify/tests/bionemo/amplify/test_model.py create mode 100644 sub-packages/bionemo-esm2/tests/bionemo/esm2/data/__init__.py diff --git a/sub-packages/bionemo-amplify/tests/bionemo/amplify/__init__.py b/sub-packages/bionemo-amplify/tests/bionemo/amplify/__init__.py new file mode 100644 index 0000000000..25e6abfbc5 --- /dev/null +++ b/sub-packages/bionemo-amplify/tests/bionemo/amplify/__init__.py @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-Apache2 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/sub-packages/bionemo-amplify/tests/bionemo/amplify/test_model.py b/sub-packages/bionemo-amplify/tests/bionemo/amplify/test_model.py new file mode 100644 index 0000000000..56d66a4fbc --- /dev/null +++ b/sub-packages/bionemo-amplify/tests/bionemo/amplify/test_model.py @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-Apache2 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from bionemo.amplify.model import AMPLIFYConfig, AMPLIFYModel +from bionemo.amplify.tokenizer import BioNeMoAMPLIFYTokenizer +from bionemo.esm2.model.embedding import ESM2Embedding +from bionemo.llm.model.biobert.model import MegatronBioBertModel +from bionemo.testing import megatron_parallel_state_utils + + +def test_amplify_model_initialized(): + with megatron_parallel_state_utils.distributed_model_parallel_state(): + tokenizer = BioNeMoAMPLIFYTokenizer() + config = AMPLIFYConfig() + model = config.configure_model(tokenizer) + + assert isinstance(model, MegatronBioBertModel) + assert isinstance(model, AMPLIFYModel) + assert isinstance(model.embedding, ESM2Embedding) diff --git a/sub-packages/bionemo-esm2/tests/bionemo/esm2/data/__init__.py b/sub-packages/bionemo-esm2/tests/bionemo/esm2/data/__init__.py new file mode 100644 index 0000000000..25e6abfbc5 --- /dev/null +++ b/sub-packages/bionemo-esm2/tests/bionemo/esm2/data/__init__.py @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-Apache2 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License.