lingobot / demo.py
Gent (PG/R - Comp Sci & Elec Eng)
add demos
a20ccd6
import pkgutil
import interfaces
import gradio as gr
import importlib
demos = []
names = []
for i in list(pkgutil.iter_modules(interfaces.__path__)):
my_package = importlib.import_module(f'interfaces.{i.name}')
my_variable = getattr(my_package, 'demo')
demos.append(my_variable)
names.append(i.name)
gr.TabbedInterface(demos,names).launch(share=True,show_error=True)