Spaces:
Sleeping
Sleeping
# 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() | |