mirror of
https://github.com/RYDE-WORK/lnp_ml.git
synced 2026-07-22 05:49:55 +08:00
Compare commits
2 Commits
33fe637364
...
182f7853d7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
182f7853d7 | ||
|
|
54c734dc16 |
@ -25,7 +25,7 @@ DEFAULT_INPUT_DIMS = {
|
|||||||
"mpnn": 600, # D-MPNN embedding
|
"mpnn": 600, # D-MPNN embedding
|
||||||
"morgan": 1024, # Morgan fingerprint
|
"morgan": 1024, # Morgan fingerprint
|
||||||
"maccs": 167, # MACCS keys
|
"maccs": 167, # MACCS keys
|
||||||
"desc": 210, # RDKit descriptors
|
"desc": 217, # RDKit descriptors
|
||||||
# Channel B: 配方/实验条件
|
# Channel B: 配方/实验条件
|
||||||
"comp": 5, # 配方比例
|
"comp": 5, # 配方比例
|
||||||
"phys": 12, # 物理参数 one-hot
|
"phys": 12, # 物理参数 one-hot
|
||||||
|
|||||||
@ -55,6 +55,13 @@ def load_model(
|
|||||||
fusion_strategy=config["fusion_strategy"],
|
fusion_strategy=config["fusion_strategy"],
|
||||||
head_hidden_dim=config["head_hidden_dim"],
|
head_hidden_dim=config["head_hidden_dim"],
|
||||||
dropout=config["dropout"],
|
dropout=config["dropout"],
|
||||||
|
use_llm=config.get("use_llm", False),
|
||||||
|
llm_model_path=config.get("llm_model_path", "models/molt5-base"),
|
||||||
|
llm_freeze=config.get("llm_freeze", True),
|
||||||
|
llm_use_lora=config.get("llm_use_lora", False),
|
||||||
|
llm_lora_r=config.get("llm_lora_r", 8),
|
||||||
|
llm_lora_alpha=config.get("llm_lora_alpha", 16),
|
||||||
|
llm_lora_dropout=config.get("llm_lora_dropout", 0.05),
|
||||||
mpnn_ensemble_paths=ensemble_paths,
|
mpnn_ensemble_paths=ensemble_paths,
|
||||||
mpnn_device=mpnn_device,
|
mpnn_device=mpnn_device,
|
||||||
)
|
)
|
||||||
@ -66,9 +73,16 @@ def load_model(
|
|||||||
fusion_strategy=config["fusion_strategy"],
|
fusion_strategy=config["fusion_strategy"],
|
||||||
head_hidden_dim=config["head_hidden_dim"],
|
head_hidden_dim=config["head_hidden_dim"],
|
||||||
dropout=config["dropout"],
|
dropout=config["dropout"],
|
||||||
|
use_llm=config.get("use_llm", False),
|
||||||
|
llm_model_path=config.get("llm_model_path", "models/molt5-base"),
|
||||||
|
llm_freeze=config.get("llm_freeze", True),
|
||||||
|
llm_use_lora=config.get("llm_use_lora", False),
|
||||||
|
llm_lora_r=config.get("llm_lora_r", 8),
|
||||||
|
llm_lora_alpha=config.get("llm_lora_alpha", 16),
|
||||||
|
llm_lora_dropout=config.get("llm_lora_dropout", 0.05),
|
||||||
)
|
)
|
||||||
|
|
||||||
model.load_state_dict(checkpoint["model_state_dict"])
|
model.load_state_dict(checkpoint["model_state_dict"], strict=False)
|
||||||
model.to(device)
|
model.to(device)
|
||||||
model.eval()
|
model.eval()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user