From 451825159f03485621f57b1153c891d56a881148 Mon Sep 17 00:00:00 2001 From: hnu202409060624 <2804411502@qq.com> Date: Mon, 30 Dec 2024 18:26:17 +0800 Subject: [PATCH] ADD file via upload --- test.py | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 test.py diff --git a/test.py b/test.py new file mode 100644 index 0000000..0cf703a --- /dev/null +++ b/test.py @@ -0,0 +1,97 @@ +import torch +import torch.nn.functional as F +import config +import json +import numpy as np +from date_build import Chem_Dataset +model=torch.load('D:\models\model3.1(150).pt') + + +def padding( chemic, lens=config.seq_len): + + while len(chemic) < lens: + chemic.append(0) + return chemic + + +def target_padding( chemical, lens=config.seq_len): + chemical.append(1) + while len(chemical)