File size: 615 Bytes
47a6c20
8a8ccdb
 
 
47a6c20
 
 
 
 
 
 
2ef1af8
 
76d290c
2ef1af8
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from model import models
import gradio as gr

if __name__ == "__main__":
    exclude_keys, interfaces, titles = ["interface"], [], []
    for model, args in models.items():
        interface = args["interface"]
        excluded_args = {k: args[k] for k in set(list(args.keys())) - set(exclude_keys)}
        interfaces.append(interface(**excluded_args))
        titles.append(model)

    # interface = gr.TabbedInterface(interfaces, titles, theme="soft")
    with gr.Blocks(theme="soft") as demo:
        gr.Markdown("# NusaBERT Demo")
        gr.TabbedInterface(interfaces, titles, theme="soft")
    demo.launch()