Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -33,17 +33,17 @@ headers = [col for col in all_headers if col in df.columns]
|
|
33 |
# Define input and output interfaces with dynamic row counts
|
34 |
inputs = [gr.Dataframe(
|
35 |
headers=headers,
|
36 |
-
|
37 |
col_count=(len(headers), "fixed"),
|
38 |
label="Input Data",
|
39 |
interactive=True
|
40 |
)]
|
41 |
|
42 |
outputs = [gr.Dataframe(
|
43 |
-
|
44 |
-
col_count=(
|
45 |
label="Predictions",
|
46 |
-
headers=["Depression"]
|
47 |
)]
|
48 |
|
49 |
|
@@ -86,7 +86,7 @@ def infer(inputs):
|
|
86 |
data = data.astype(float)
|
87 |
|
88 |
predictions = pipe.predict(data)
|
89 |
-
return pd.DataFrame(predictions, columns=["Depression"])
|
90 |
|
91 |
|
92 |
|
|
|
33 |
# Define input and output interfaces with dynamic row counts
|
34 |
inputs = [gr.Dataframe(
|
35 |
headers=headers,
|
36 |
+
row_count=(10, "dynamic"), # Use tuple format (min_rows, "dynamic")
|
37 |
col_count=(len(headers), "fixed"),
|
38 |
label="Input Data",
|
39 |
interactive=True
|
40 |
)]
|
41 |
|
42 |
outputs = [gr.Dataframe(
|
43 |
+
row_count=(10, "dynamic"), # Use tuple format (min_rows, "dynamic")
|
44 |
+
col_count=(2, "fixed"),
|
45 |
label="Predictions",
|
46 |
+
headers=["Name", "Depression"]
|
47 |
)]
|
48 |
|
49 |
|
|
|
86 |
data = data.astype(float)
|
87 |
|
88 |
predictions = pipe.predict(data)
|
89 |
+
return pd.DataFrame(predictions, columns=["Name", "Depression"])
|
90 |
|
91 |
|
92 |
|