Commit
·
aa94aff
1
Parent(s):
547218d
created my own f(x) to load in examples
Browse files- app.py +13 -1
- examples/log.csv → examples.csv +0 -0
app.py
CHANGED
@@ -65,6 +65,18 @@ def predict(
|
|
65 |
|
66 |
return label
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
def load_interface():
|
69 |
'''
|
70 |
Configure Gradio interface
|
@@ -211,7 +223,7 @@ def load_interface():
|
|
211 |
predict,
|
212 |
inputs=inputs,
|
213 |
outputs=smoker_label,
|
214 |
-
examples="
|
215 |
title="Interact with the Ensemble Classifier Model",
|
216 |
description="**Medical Disclaimer**: The predictions provided by this model are for educational purposes only and should not be considered a substitute for professional medical advice."
|
217 |
)
|
|
|
65 |
|
66 |
return label
|
67 |
|
68 |
+
def load_examples(csv_file):
|
69 |
+
'''
|
70 |
+
Load examples from csv file
|
71 |
+
'''
|
72 |
+
# Read examples from CSV file
|
73 |
+
df = pd.read_csv(csv_file)
|
74 |
+
|
75 |
+
# Convert DataFrame to a list of lists
|
76 |
+
examples = df.values.tolist()
|
77 |
+
|
78 |
+
return examples
|
79 |
+
|
80 |
def load_interface():
|
81 |
'''
|
82 |
Configure Gradio interface
|
|
|
223 |
predict,
|
224 |
inputs=inputs,
|
225 |
outputs=smoker_label,
|
226 |
+
examples=load_examples("examples.csv"),
|
227 |
title="Interact with the Ensemble Classifier Model",
|
228 |
description="**Medical Disclaimer**: The predictions provided by this model are for educational purposes only and should not be considered a substitute for professional medical advice."
|
229 |
)
|
examples/log.csv → examples.csv
RENAMED
File without changes
|