fahadcr14 commited on
Commit
d6396d6
·
1 Parent(s): 255cd27
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -69,11 +69,17 @@ def home():
69
  form_type = request.form.get('form_type')
70
 
71
  if form_type == 'cloud_computing':
72
- input_activities = {activity: float(request.form.get(activity, 0)) for activity in cc_weights.keys()}
 
 
 
73
  cc_predicted_score = predict_final_score(input_activities, cc_weights, cc_max_marks, "cloud_computing")
74
 
75
  elif form_type == 'ict':
76
- input_activities = {activity: float(request.form.get(activity, 0)) for activity in ict_weights.keys()}
 
 
 
77
  ict_predicted_score = predict_final_score(input_activities, ict_weights, ict_max_marks, "ict")
78
 
79
  return render_template(
 
69
  form_type = request.form.get('form_type')
70
 
71
  if form_type == 'cloud_computing':
72
+ input_activities = {
73
+ activity: float(request.form.get(activity, 0) or 0) # Default to 0 for empty inputs
74
+ for activity in cc_weights.keys()
75
+ }
76
  cc_predicted_score = predict_final_score(input_activities, cc_weights, cc_max_marks, "cloud_computing")
77
 
78
  elif form_type == 'ict':
79
+ input_activities = {
80
+ activity: float(request.form.get(activity, 0) or 0) # Default to 0 for empty inputs
81
+ for activity in ict_weights.keys()
82
+ }
83
  ict_predicted_score = predict_final_score(input_activities, ict_weights, ict_max_marks, "ict")
84
 
85
  return render_template(