File size: 673 Bytes
be1bd10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from aiconfig import AIConfigRuntime, ModelParserRegistry, DalleImageGenerationParser


# Example of how users can register model parsers for use in the GradioWorkbook
# The implementation looks for a parsers_path (model_parsers.py by default) which
# should include a module with a register_model_parsers function.
# Here we are registering all the local HuggingFace model parsers as an example
def register_model_parsers() -> None:

    dalle_image_generation_models = [
        "dall-e-2",
        "dall-e-3",
    ]
    for model in dalle_image_generation_models:
        ModelParserRegistry.register_model_parser(
            DalleImageGenerationParser(model)
        )