Skip to content

Commit

Permalink
update __init__
Browse files Browse the repository at this point in the history
  • Loading branch information
jm12138 committed Jun 13, 2021
1 parent 7821edc commit f97df1c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions ppim/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
import ppim.models as models

from ppim.models import *
from inspect import isfunction, isclass

version = "1.1.0"
models_dict = {}
models_list = []


for k, v in models.__dict__.items():
if isfunction(v):
model_name = k.split("_")[0]
if model_name not in models_dict:
models_dict[model_name] = [k]
else:
models_dict[model_name].append(k)
elif isclass(v):
models_list.append(k)


def available():
print("The pretrained models list as follow:")
print("\n".join([str({k: v}) for k, v in models_dict.items()]))

print("The models support as follow:")
print("\n".join(str([item]) for item in models_list))

0 comments on commit f97df1c

Please # to comment.