Spaces:
Runtime error
Runtime error
File size: 1,051 Bytes
b9e5784 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
import gradio as gr
import groovy as gv
from flow import flow
with gr.Blocks() as app:
task_box = gr.Textbox(label="🕺 Task", value="flow.task" info="Run this workflow locally by installing the [Groovy Python package](https://github.com/abidlabs/groovy) and then running `groovy run https://huggingface.co/space/url>`.)
with gr.Row():
if flow.inputs:
with gr.Column(scale=1):
for component in flow.inputs:
component.render()
with gr.Column(scale=2):
gr.Image(label="Recording", value="../../.groovy/recording.gif")
config = gr.JSON(visible=False)
@gr.on(
triggers=[app.load] + [input.change for input in flow.inputs],
inputs=flow.inputs,
outputs=[task_box],
trigger_mode="always_last",
show_api=False
)
def construct_prompt(*input_values):
return flow.task.format(*input_values)
app.load(flow.to_json, None, config, api_name="flow_config")
if __name__ == "__main__":
app.launch()
|