Allow extensions to have custom display_name (#1242)

Co-authored-by: oobabooga <112222186+oobabooga@users.noreply.github.com>
This commit is contained in:
ye7iaserag 2023-05-17 07:08:22 +03:00 committed by GitHub
parent ad0b71af11
commit acf3dbbcc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,5 +173,7 @@ def create_extensions_block():
with gr.Column(elem_id="extensions"):
for extension, name in iterator():
if hasattr(extension, "ui"):
gr.Markdown(f"\n### {name}")
gr.Markdown(f"\n### {extension.params['display_name']}"
if hasattr(extension, 'params') and extension.params.__contains__('display_name')
else f"\n### {name}")
extension.ui()