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/06_export_gan_npz.R from OneScience-Group/Antibody_deep_learning: direct link, hf CLI and curl.
- Browser
- Download file 774 Bytes
-
https://huggingface.co/OneScience-Group/Antibody_deep_learning/resolve/main/scripts/06_export_gan_npz.R
- Command line
-
hf download hf://OneScience-Group/Antibody_deep_learning/scripts/06_export_gan_npz.R
-
curl -L -o 06_export_gan_npz.R https://huggingface.co/OneScience-Group/Antibody_deep_learning/resolve/main/scripts/06_export_gan_npz.R
774 Bytes
| args <- commandArgs(trailingOnly = FALSE) | |
| script_arg <- grep("^--file=", args, value = TRUE) | |
| if (length(script_arg) > 0) { | |
| script_path <- normalizePath(sub("^--file=", "", script_arg[1])) | |
| setwd(normalizePath(file.path(dirname(script_path), ".."))) | |
| } | |
| library(reticulate) | |
| use_python(Sys.getenv("RETICULATE_PYTHON"), required = TRUE) | |
| np <- import("numpy", convert = FALSE) | |
| encoded <- readRDS("model/GAN/seq_all_encoded.RDS") | |
| names_encoded <- names(encoded) | |
| for (i in seq_along(encoded)) { | |
| out_file <- sprintf("model/GAN/seq_encoded_%02d.npz", i) | |
| np$savez_compressed( | |
| out_file, | |
| x = np$array(encoded[[i]], dtype = "float32"), | |
| name = names_encoded[[i]] | |
| ) | |
| cat("saved", out_file, names_encoded[[i]], dim(encoded[[i]]), "\n") | |
| } | |
| cat("export GAN npz OK\n") | |