Skip to content

Commit f97df1c

Browse files
committed
update __init__
1 parent 7821edc commit f97df1c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

ppim/__init__.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
1+
import ppim.models as models
2+
13
from ppim.models import *
4+
from inspect import isfunction, isclass
5+
6+
version = "1.1.0"
7+
models_dict = {}
8+
models_list = []
9+
10+
11+
for k, v in models.__dict__.items():
12+
if isfunction(v):
13+
model_name = k.split("_")[0]
14+
if model_name not in models_dict:
15+
models_dict[model_name] = [k]
16+
else:
17+
models_dict[model_name].append(k)
18+
elif isclass(v):
19+
models_list.append(k)
20+
21+
22+
def available():
23+
print("The pretrained models list as follow:")
24+
print("\n".join([str({k: v}) for k, v in models_dict.items()]))
25+
26+
print("The models support as follow:")
27+
print("\n".join(str([item]) for item in models_list))

0 commit comments

Comments
 (0)