File size: 2,357 Bytes
fbc2291
 
 
 
 
 
 
 
 
41a03fb
fbc2291
 
 
 
 
 
 
 
 
 
 
 
 
41a03fb
 
 
fbc2291
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41a03fb
 
fbc2291
 
41a03fb
 
fbc2291
 
41a03fb
 
fbc2291
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

from mammal_demo.demo_framework import (
    ModelRegistry,
    TaskRegistry,
)
from mammal_demo.dti_task import DtiTask
from mammal_demo.ppi_task import PpiTask
from mammal_demo.ps_task import PsTask
from mammal_demo.tcr_task import TcrTask
from mammal_demo.molnet_task import MolnetTask

def tasks_and_models():
    all_tasks = TaskRegistry()
    all_models = ModelRegistry()

# first create the required tasks
# Note that the tasks need access to the models, as the model to use depends on the state of the widget
# we pass the all_models dict and update it when we actualy have the models.

    ppi_task = all_tasks.register_task(PpiTask(model_dict=all_models))
    tdi_task = all_tasks.register_task(DtiTask(model_dict=all_models))
    ps_task = all_tasks.register_task(PsTask(model_dict=all_models))
    tcr_task = all_tasks.register_task(TcrTask(model_dict=all_models))
    bbbp_task = all_tasks.register_task(MolnetTask(model_dict=all_models,task_name="BBBP"))
    toxicity_task = all_tasks.register_task(MolnetTask(model_dict=all_models,task_name="TOXICITY"))
    fda_appr_task = all_tasks.register_task(MolnetTask(model_dict=all_models,task_name="FDA_APPR"))

# create the model holders. hold the model and the tokenizer, lazy download
# note that the list of relevent tasks needs to be stated.
    all_models.register_model(
    model_path="ibm/biomed.omics.bl.sm.ma-ted-458m.dti_bindingdb_pkd",
    task_list=[tdi_task],
)
    all_models.register_model(
    model_path="ibm/biomed.omics.bl.sm.ma-ted-458m.dti_bindingdb_pkd_peer",
    task_list=[tdi_task],
)

    all_models.register_model(
    model_path="ibm/biomed.omics.bl.sm.ma-ted-458m.tcr_epitope_bind",
    task_list=[tcr_task],
)
    all_models.register_model(
    model_path="ibm/biomed.omics.bl.sm.ma-ted-458m.protein_solubility",
    task_list=[ps_task],
)
    all_models.register_model(
    model_path="ibm/biomed.omics.bl.sm.ma-ted-458m",
    task_list=[ppi_task],
)
    all_models.register_model(
    "ibm/biomed.omics.bl.sm.ma-ted-458m.moleculenet_clintox_tox",
    task_list=[toxicity_task]
)
    all_models.register_model(
    "ibm/biomed.omics.bl.sm.ma-ted-458m.moleculenet_clintox_fda",
    task_list=[fda_appr_task]
)
    all_models.register_model(
    "ibm/biomed.omics.bl.sm.ma-ted-458m.moleculenet_bbbp",
    task_list=[bbbp_task],
)
    
    return all_tasks,all_models