-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |