bndl commited on
Commit
2e494c5
·
1 Parent(s): 9e770a8

Update build_gradio_graph.py

Browse files
Files changed (1) hide show
  1. build_gradio_graph.py +3 -1
build_gradio_graph.py CHANGED
@@ -55,7 +55,7 @@ def call_predict(inference_dict, cols_order, numerical_columns, target_columns):
55
  print(y_pred)
56
  outputs = []
57
  for i in range(len(target_columns)):
58
- outputs += [y_pred[i]]
59
  outputs += [10]
60
  # outputs += [fig]
61
 
@@ -138,6 +138,8 @@ def add_gradio_component(config_dict, component_key):
138
  new_component = gr.Plot(label=config_dict[component_key]["label"], type="matplotlib")
139
  elif config_dict[component_key]["comp_type"] == "Dataframe":
140
  new_component = gr.Dataframe(wrap=True, type="pandas")
 
 
141
  else:
142
  print(
143
  f"Found component type {config_dict[component_key]['comp_type']} for {component_key}, which is not supported"
 
55
  print(y_pred)
56
  outputs = []
57
  for i in range(len(target_columns)):
58
+ outputs += [y_pred[i][0]]
59
  outputs += [10]
60
  # outputs += [fig]
61
 
 
138
  new_component = gr.Plot(label=config_dict[component_key]["label"], type="matplotlib")
139
  elif config_dict[component_key]["comp_type"] == "Dataframe":
140
  new_component = gr.Dataframe(wrap=True, type="pandas")
141
+ elif config_dict[component_key]["comp_type"] == "Slider":
142
+ new_component = gr.Slider(label=config_dict[component_key]["label"], minimum=config_dict[component_key]["minimum"], maximum=config_dict[component_key]["maximum"], step=config_dict[component_key]["step"])
143
  else:
144
  print(
145
  f"Found component type {config_dict[component_key]['comp_type']} for {component_key}, which is not supported"