__get_model_config.py 372 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
11
12
            return {
                "moderation_level": obj["moderation_level"],
                "model": model
            }
13
14

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