__get_model_config.py 310 Bytes
Newer Older
1
from general.api import get_api_config
2
3


Florent Chehab's avatar
Florent Chehab committed
4
def get_model_config(model):
5
6
7
8
    api_config = get_api_config()

    for obj in api_config:
        if obj['model'] == model:
Florent Chehab's avatar
Florent Chehab committed
9
            return {"moderation_level": obj["moderation_level"]}
10
11

    raise Exception("Model not found in API configuraiton, cannot process !")