silvaKenpachi commited on
Commit
92a5021
·
verified ·
1 Parent(s): 5a93914

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -2
app.py CHANGED
@@ -25,8 +25,27 @@ headers = [col for col in all_headers if col in df.columns]
25
 
26
  # Define input and output interfaces
27
  #inputs = [gr.Dataframe(headers=headers, row_count=(2, "dynamic"), col_count=(len(headers), "fixed"), label="Input Data", interactive=True)]
28
- inputs = [gr.Dataframe(headers=all_headers, row_count=(2, "dynamic"), col_count=(len(all_headers), "fixed"), label="Input Data", interactive=True)]
29
- outputs = [gr.Dataframe(row_count=(2, "dynamic"), col_count=(1, "fixed"), label="Predictions", headers=["Depression"])]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
  #def infer(inputs):
32
  #data = pd.DataFrame(inputs, columns=headers)
 
25
 
26
  # Define input and output interfaces
27
  #inputs = [gr.Dataframe(headers=headers, row_count=(2, "dynamic"), col_count=(len(headers), "fixed"), label="Input Data", interactive=True)]
28
+
29
+ #working code that returns only 2 rows in output
30
+ #inputs = [gr.Dataframe(headers=all_headers, row_count=(2, "dynamic"), col_count=(len(all_headers), "fixed"), label="Input Data", interactive=True)]
31
+ #outputs = [gr.Dataframe(row_count=(2, "dynamic"), col_count=(1, "fixed"), label="Predictions", headers=["Depression"])]
32
+
33
+ # Define input and output interfaces with dynamic row counts
34
+ inputs = [gr.Dataframe(
35
+ headers=headers,
36
+ row_count="dynamic", # Remove the tuple and just use "dynamic"
37
+ col_count=(len(headers), "fixed"),
38
+ label="Input Data",
39
+ interactive=True
40
+ )]
41
+
42
+ outputs = [gr.Dataframe(
43
+ row_count="dynamic", # Remove the tuple and just use "dynamic"
44
+ col_count=(1, "fixed"),
45
+ label="Predictions",
46
+ headers=["Depression"]
47
+ )]
48
+
49
 
50
  #def infer(inputs):
51
  #data = pd.DataFrame(inputs, columns=headers)