Commit 373ff5a2 authored by huchenlei's avatar huchenlei

🐛 Allow Script to have metaclass

parent baf6946e
......@@ -2,6 +2,7 @@ import os
import re
import sys
import traceback
import inspect
from collections import namedtuple
import gradio as gr
......@@ -238,7 +239,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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment