Update src/streamlit_app.py
Browse files- src/streamlit_app.py +6 -14
src/streamlit_app.py
CHANGED
|
@@ -9,11 +9,9 @@ st.title("π― Engineering College Predictor")
|
|
| 9 |
st.write("Enter your details below:")
|
| 10 |
|
| 11 |
# π Input controls
|
| 12 |
-
category = st.selectbox("Category", [
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
'GNTD', 'LNTC', 'LNTD', 'ORP'
|
| 16 |
-
])
|
| 17 |
|
| 18 |
course_list = [
|
| 19 |
'Civil Engineering', 'Computer Science and Engineering',
|
|
@@ -62,16 +60,14 @@ course_list = [
|
|
| 62 |
'Computer Science and Engineering (Artificial Intelligence)'
|
| 63 |
]
|
| 64 |
|
|
|
|
| 65 |
course_list_sorted = sorted(course_list)
|
| 66 |
|
| 67 |
-
course = st.selectbox("
|
| 68 |
|
| 69 |
rank = st.number_input("Rank", min_value=1, value=1500)
|
| 70 |
percentage = st.number_input("Percentage", min_value=0.0, max_value=100.0, value=75.0)
|
| 71 |
|
| 72 |
-
# π· Optional Location
|
| 73 |
-
location = st.text_input("Preferred Location (optional)")
|
| 74 |
-
|
| 75 |
if st.button("Predict Top 20 Choices"):
|
| 76 |
payload = {
|
| 77 |
"Category": category,
|
|
@@ -80,10 +76,6 @@ if st.button("Predict Top 20 Choices"):
|
|
| 80 |
"Course Name": course
|
| 81 |
}
|
| 82 |
|
| 83 |
-
# If location is provided, add it
|
| 84 |
-
if location.strip():
|
| 85 |
-
payload["Location"] = location.strip()
|
| 86 |
-
|
| 87 |
# π· Call your backend API
|
| 88 |
resp = requests.post(BACKEND_URL, json=payload)
|
| 89 |
if resp.status_code != 200:
|
|
@@ -110,4 +102,4 @@ if st.button("Predict Top 20 Choices"):
|
|
| 110 |
st.dataframe(
|
| 111 |
df.style.hide(axis="index"),
|
| 112 |
use_container_width=True
|
| 113 |
-
)
|
|
|
|
| 9 |
st.write("Enter your details below:")
|
| 10 |
|
| 11 |
# π Input controls
|
| 12 |
+
category = st.selectbox("Category", ['GOPEN', 'GSC', 'GSEBC', 'LOPEN', 'LST', 'LOBC', 'EWS', 'GST',
|
| 13 |
+
'GOBC', 'LSEBC', 'LSC', 'GNTA', 'LNTB', 'GNTB', 'GNTC', 'LNTA',
|
| 14 |
+
'GNTD', 'LNTC', 'LNTD', 'ORP'])
|
|
|
|
|
|
|
| 15 |
|
| 16 |
course_list = [
|
| 17 |
'Civil Engineering', 'Computer Science and Engineering',
|
|
|
|
| 60 |
'Computer Science and Engineering (Artificial Intelligence)'
|
| 61 |
]
|
| 62 |
|
| 63 |
+
# Sort alphabetically
|
| 64 |
course_list_sorted = sorted(course_list)
|
| 65 |
|
| 66 |
+
course = st.selectbox("Category", course_list_sorted)
|
| 67 |
|
| 68 |
rank = st.number_input("Rank", min_value=1, value=1500)
|
| 69 |
percentage = st.number_input("Percentage", min_value=0.0, max_value=100.0, value=75.0)
|
| 70 |
|
|
|
|
|
|
|
|
|
|
| 71 |
if st.button("Predict Top 20 Choices"):
|
| 72 |
payload = {
|
| 73 |
"Category": category,
|
|
|
|
| 76 |
"Course Name": course
|
| 77 |
}
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
# π· Call your backend API
|
| 80 |
resp = requests.post(BACKEND_URL, json=payload)
|
| 81 |
if resp.status_code != 200:
|
|
|
|
| 102 |
st.dataframe(
|
| 103 |
df.style.hide(axis="index"),
|
| 104 |
use_container_width=True
|
| 105 |
+
)
|