From 5fbbac36cc5968d2ebb765e660afb351cb8a1bba Mon Sep 17 00:00:00 2001 From: Kexin Huang Date: Fri, 20 Jan 2023 00:05:09 -0800 Subject: [PATCH 1/2] add TDC snippet --- js/src/lib/interfaces/Libraries.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/js/src/lib/interfaces/Libraries.ts b/js/src/lib/interfaces/Libraries.ts index 7ceda88d4..c49ec8594 100644 --- a/js/src/lib/interfaces/Libraries.ts +++ b/js/src/lib/interfaces/Libraries.ts @@ -32,6 +32,7 @@ export enum ModelLibrary { "stable-baselines3" = "Stable-Baselines3", "ml-agents" = "ML-Agents", "pythae" = "Pythae", + "tdc" = "TDC" } export type ModelLibraryKey = keyof typeof ModelLibrary; @@ -416,6 +417,16 @@ const pythae = (model: ModelData) => model = AutoModel.load_from_hf_hub("${model.id}")`; +const tdc = (model: ModelData) => + `from tdc import tdc_hf_interface + # initialize an interface object with HF repo name + tdc_hf_herg = tdc_hf_interface("${model.id}") + # upload folder/files to this repo + tdc_hf_herg.upload('./XXX') + # load deeppurpose model from this repo + dp_model = tdc_hf_herg.load_deeppurpose('./data') + dp_model.predict(XXX)`; + //#endregion @@ -572,5 +583,11 @@ export const MODEL_LIBRARIES_UI_ELEMENTS: Partial Date: Fri, 20 Jan 2023 00:17:30 -0800 Subject: [PATCH 2/2] update tdc code snippet --- js/src/lib/interfaces/Libraries.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/src/lib/interfaces/Libraries.ts b/js/src/lib/interfaces/Libraries.ts index c49ec8594..8cbbb85a0 100644 --- a/js/src/lib/interfaces/Libraries.ts +++ b/js/src/lib/interfaces/Libraries.ts @@ -420,12 +420,12 @@ model = AutoModel.load_from_hf_hub("${model.id}")`; const tdc = (model: ModelData) => `from tdc import tdc_hf_interface # initialize an interface object with HF repo name - tdc_hf_herg = tdc_hf_interface("${model.id}") + tdc_hf = tdc_hf_interface("${model.id}") # upload folder/files to this repo - tdc_hf_herg.upload('./XXX') + tdc_hf.upload('UPLOAD FOLDER PATH') # load deeppurpose model from this repo - dp_model = tdc_hf_herg.load_deeppurpose('./data') - dp_model.predict(XXX)`; + dp_model = tdc_hf.load_deeppurpose('SAVED FOLDER PATH') + dp_model.predict('YOUR SMILES STRING')`; //#endregion