abidlabs HF Staff commited on
Commit
b9c6c2f
·
verified ·
1 Parent(s): 1923bc2

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +16 -3
app.py CHANGED
@@ -2,9 +2,22 @@ import gradio as gr
2
  from flow import flow
3
 
4
  with gr.Blocks() as app:
5
- for component in flow.inputs:
6
- component.interactive = True
7
- component.render()
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  if __name__ == "__main__":
10
  app.launch()
 
2
  from flow import flow
3
 
4
  with gr.Blocks() as app:
5
+ task_box = gr.Textbox(label="🕺 Groovy Flow", value="flow.task")
6
+ with gr.Row():
7
+ for component in flow.inputs:
8
+ component.render()
9
+
10
+ @gr.on(
11
+ triggers=[app.load] + [input.change for input in flow.inputs],
12
+ inputs=flow.inputs,
13
+ outputs=[task_box],
14
+ trigger_mode="always_last",
15
+ )
16
+ def construct_task(*input_values):
17
+ return flow.task.format(*input_values)
18
+
19
+ with gr.Row(scale=5):
20
+ gr.Image()
21
 
22
  if __name__ == "__main__":
23
  app.launch()