Skip to content

Commit

Permalink
Merge pull request #11264 from huchenlei/meta_class
Browse files Browse the repository at this point in the history
🐛 Allow Script to have custom metaclass
  • Loading branch information
AUTOMATIC1111 authored Jun 27, 2023
2 parents 2c43dd7 + 58a9a26 commit bedcd2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/scripts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import re
import sys
import inspect
from collections import namedtuple

import gradio as gr
Expand Down Expand Up @@ -249,7 +250,7 @@ def load_scripts():

def register_scripts_from_module(module):
for script_class in module.__dict__.values():
if type(script_class) != type:
if not inspect.isclass(script_class):
continue

if issubclass(script_class, Script):
Expand Down

0 comments on commit bedcd2f

Please sign in to comment.