Instructions to use OneScience-Group/Antibody_deep_learning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- TF-Keras
How to use OneScience-Group/Antibody_deep_learning with TF-Keras:
# Note: 'keras<3.x' or 'tf_keras' must be installed (legacy), and from_pretrained_keras was removed in huggingface_hub 1.0. # See https://github.com/keras-team/tf-keras for more details. # !pip install "huggingface_hub<1.0" tf_keras from huggingface_hub import from_pretrained_keras model = from_pretrained_keras("OneScience-Group/Antibody_deep_learning") - Notebooks
- Google Colab
- Kaggle
Download scripts/tf_savedmodel_helper.py from OneScience-Group/Antibody_deep_learning: direct link, hf CLI and curl.
- Browser
- Download file 382 Bytes
-
https://huggingface.co/OneScience-Group/Antibody_deep_learning/resolve/main/scripts/tf_savedmodel_helper.py
- Command line
-
hf download hf://OneScience-Group/Antibody_deep_learning/scripts/tf_savedmodel_helper.py
-
curl -L -o tf_savedmodel_helper.py https://huggingface.co/OneScience-Group/Antibody_deep_learning/resolve/main/scripts/tf_savedmodel_helper.py
382 Bytes
| import numpy as np | |
| import tensorflow as tf | |
| def predict_saved_model(model_dir, input_name, x): | |
| model = tf.saved_model.load(model_dir) | |
| serving = model.signatures["serving_default"] | |
| x = np.asarray(x, dtype=np.float32) | |
| with tf.device("/GPU:0"): | |
| out = serving(**{input_name: tf.constant(x)}) | |
| first_key = list(out.keys())[0] | |
| return out[first_key].numpy() | |