Spaces:
Paused
Paused
File size: 555 Bytes
d77bc81 9af1228 d77bc81 9af1228 d77bc81 9af1228 d77bc81 9af1228 d77bc81 9af1228 d77bc81 9af1228 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# app.py
import gradio as gr
from tool_registry import TOOL_REGISTRY
def build_dynamic_interface():
interfaces = []
titles = []
for tool in TOOL_REGISTRY:
iface = gr.Interface(
fn=tool["func"],
inputs=tool["inputs"],
outputs=tool["outputs"],
api_name=tool.get("api_name")
)
interfaces.append(iface)
titles.append(tool["name"])
return gr.TabbedInterface(interfaces, titles)
if __name__ == "__main__":
demo = build_dynamic_interface()
demo.launch()
|