Spaces:
Sleeping
Sleeping
judebebo32
commited on
Commit
•
4329151
1
Parent(s):
4b96792
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
import subprocess
|
2 |
import sys
|
3 |
|
4 |
-
#
|
5 |
try:
|
6 |
import sklearn
|
7 |
except ModuleNotFoundError:
|
8 |
subprocess.check_call([sys.executable, "-m", "pip", "install", "scikit-learn"])
|
9 |
-
import sklearn
|
10 |
|
11 |
import gradio as gr
|
12 |
import pandas as pd
|
@@ -59,4 +59,18 @@ interface = gr.Interface(
|
|
59 |
inputs=[
|
60 |
gr.Dropdown(['morning', 'afternoon', 'evening'], label="Time of Day"),
|
61 |
gr.Dropdown(['mild', 'regular', 'strong'], label="Coffee Strength"),
|
62 |
-
gr.Dropdown(['unsweetened', 'lightly sweetened',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import subprocess
|
2 |
import sys
|
3 |
|
4 |
+
# Force install scikit-learn if not found
|
5 |
try:
|
6 |
import sklearn
|
7 |
except ModuleNotFoundError:
|
8 |
subprocess.check_call([sys.executable, "-m", "pip", "install", "scikit-learn"])
|
9 |
+
import sklearn # Import again after installation
|
10 |
|
11 |
import gradio as gr
|
12 |
import pandas as pd
|
|
|
59 |
inputs=[
|
60 |
gr.Dropdown(['morning', 'afternoon', 'evening'], label="Time of Day"),
|
61 |
gr.Dropdown(['mild', 'regular', 'strong'], label="Coffee Strength"),
|
62 |
+
gr.Dropdown(['unsweetened', 'lightly sweetened', 'sweet'], label="Sweetness Level"),
|
63 |
+
gr.Dropdown(['none', 'regular', 'skim', 'almond'], label="Milk Type"),
|
64 |
+
gr.Dropdown(['hot', 'iced', 'cold brew'], label="Coffee Temperature"),
|
65 |
+
gr.Dropdown(['yes', 'no'], label="Flavored Coffee"),
|
66 |
+
gr.Dropdown(['low', 'medium', 'high'], label="Caffeine Tolerance"),
|
67 |
+
gr.Dropdown(['Arabica', 'Robusta', 'blend'], label="Coffee Bean"),
|
68 |
+
gr.Dropdown(['small', 'medium', 'large'], label="Coffee Size"),
|
69 |
+
gr.Dropdown(['none', 'vegan', 'lactose-intolerant'], label="Dietary Preferences")
|
70 |
+
],
|
71 |
+
outputs=gr.Textbox(label="Recommended Coffee Type"),
|
72 |
+
title="Coffee Type Recommendation"
|
73 |
+
)
|
74 |
+
|
75 |
+
if __name__ == "__main__":
|
76 |
+
interface.launch()
|