ASNVS commited on
Commit
db563ad
·
verified ·
1 Parent(s): 49718ed
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -39,8 +39,9 @@ joblib.dump(label_encoders, "label_encoders.pkl")
39
 
40
  # Prediction function
41
  def predict_colleges(category, gender, rank, region):
42
- if not isinstance(rank, (int, float)) or rank < 0 or not re.match(r'^\d+$', str(int(rank))):
43
- return "Invalid Rank: Please enter a valid positive integer without symbols."
 
44
 
45
  # Load label encoders
46
  label_encoders = joblib.load("label_encoders.pkl")
@@ -83,7 +84,9 @@ demo = gr.Interface(
83
  ],
84
  outputs=gr.Dataframe(headers=["College Name", "Branch"]),
85
  title="AP EAPCET College Predictor",
86
- description="Enter your details to predict all possible colleges and branches based on your rank."
 
 
87
  )
88
 
89
  demo.launch()
 
39
 
40
  # Prediction function
41
  def predict_colleges(category, gender, rank, region):
42
+ # Validate rank input
43
+ if not isinstance(rank, (int, float)) or rank < 0 or "-" in str(rank) or not re.match(r'^\d+$', str(int(rank))):
44
+ return "Invalid Rank: Please enter a valid positive integer without symbols or negative values."
45
 
46
  # Load label encoders
47
  label_encoders = joblib.load("label_encoders.pkl")
 
84
  ],
85
  outputs=gr.Dataframe(headers=["College Name", "Branch"]),
86
  title="AP EAPCET College Predictor",
87
+ description="Enter your details to predict all possible colleges and branches based on your rank.",
88
+ theme="soft",
89
+ css=".gradio-container .footer {display: none !important;}"
90
  )
91
 
92
  demo.launch()