SpringyBon commited on
Commit
b7719a5
·
verified ·
1 Parent(s): 30946de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -12,9 +12,9 @@ def load_model():
12
 
13
  # Backward-compatible defaults if old pickle didn't include bounds
14
  feature_mins = bundle.get("feature_mins", {
15
- "Attendance": 70, "StudyHours": 1, "ParentalSupport": 1, "SleepHours": 5,
16
- "ReadingHours": 0, "BehaviorScore": 1, "PretestScore": 0,
17
- "HomeworkCompletion": 0, "Participation": 1
18
  })
19
  feature_maxs = bundle.get("feature_maxs", {
20
  "Attendance": 100, "StudyHours": 20, "ParentalSupport": 5, "SleepHours": 12,
@@ -51,17 +51,17 @@ def predict_fn(attendance, study_hours, parent_support, sleep_hours, reading_hou
51
  with gr.Blocks() as iface:
52
  gr.Markdown("# Student Score Predictor (Pickle Model)")
53
  with gr.Row():
54
- attendance = gr.Slider(70, 100, value=90, step=1, label="Attendance (%)")
55
- study_hours = gr.Slider(1, 20, value=5, step=1, label="Study Hours / week")
56
- parent_support = gr.Slider(1, 5, value=3, step=1, label="Parental Support (1-5)")
57
  with gr.Row():
58
- sleep_hours = gr.Slider(5, 12, value=8, step=1, label="Sleep Hours / night")
59
  reading_hours = gr.Slider(0, 20, value=2, step=1, label="Reading Hours / week")
60
- behavior_score = gr.Slider(1, 10, value=7, step=1, label="Behavior Score (1-10)")
61
  with gr.Row():
62
  pretest_score = gr.Slider(0, 100, value=70, step=1, label="Pretest Score")
63
  homework_completion = gr.Slider(0, 100, value=85, step=1, label="Homework Completion (%)")
64
- participation = gr.Slider(1, 10, value=6, step=1, label="Participation (1-10)")
65
 
66
  out = gr.JSON(label="Predicted Scores")
67
  gr.Button("Predict").click(
 
12
 
13
  # Backward-compatible defaults if old pickle didn't include bounds
14
  feature_mins = bundle.get("feature_mins", {
15
+ "Attendance": 0, "StudyHours": 0, "ParentalSupport": 0, "SleepHours": 0,
16
+ "ReadingHours": 0, "BehaviorScore": 0, "PretestScore": 0,
17
+ "HomeworkCompletion": 0, "Participation": 0
18
  })
19
  feature_maxs = bundle.get("feature_maxs", {
20
  "Attendance": 100, "StudyHours": 20, "ParentalSupport": 5, "SleepHours": 12,
 
51
  with gr.Blocks() as iface:
52
  gr.Markdown("# Student Score Predictor (Pickle Model)")
53
  with gr.Row():
54
+ attendance = gr.Slider(0, 100, value=90, step=1, label="Attendance (%)")
55
+ study_hours = gr.Slider(0, 20, value=5, step=1, label="Study Hours / week")
56
+ parent_support = gr.Slider(0, 5, value=3, step=1, label="Parental Support (1-5)")
57
  with gr.Row():
58
+ sleep_hours = gr.Slider(0, 12, value=8, step=1, label="Sleep Hours / night")
59
  reading_hours = gr.Slider(0, 20, value=2, step=1, label="Reading Hours / week")
60
+ behavior_score = gr.Slider(0, 10, value=7, step=1, label="Behavior Score (1-10)")
61
  with gr.Row():
62
  pretest_score = gr.Slider(0, 100, value=70, step=1, label="Pretest Score")
63
  homework_completion = gr.Slider(0, 100, value=85, step=1, label="Homework Completion (%)")
64
+ participation = gr.Slider(0, 10, value=6, step=1, label="Participation (1-10)")
65
 
66
  out = gr.JSON(label="Predicted Scores")
67
  gr.Button("Predict").click(