__get_model_config.py 419 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 10
            return {
                "moderation_level": obj["moderation_level"],
11 12
                "model": model,
                "read_only": obj["read_only"]
Florent Chehab's avatar
Florent Chehab committed
13
            }
14 15

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