Spaces:
Runtime error
Runtime error
Create model_parsers.py
Browse files- model_parsers.py +9 -0
model_parsers.py
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from aiconfig import AIConfigRuntime, ModelParserRegistry
|
2 |
+
from aiconfig.default_parsers.dalle import DalleImageGenerationParser
|
3 |
+
|
4 |
+
|
5 |
+
# By default, gradio implementation will register all supported HF remote inference models
|
6 |
+
# For this example, we only want Dall-E, so clear all registered models and then add Dall-E
|
7 |
+
def register_model_parsers() -> None:
|
8 |
+
ModelParserRegistry.clear_registry()
|
9 |
+
ModelParserRegistry.register_model_parser(DalleImageGenerationParser('dall-e-3'))
|