PowerCompute750's picture
Upload 4 files
d40e39e verified
import gradio as gr
import pickle
import numpy as np
# Load model
with open("model.pkl", "rb") as f:
model = pickle.load(f)
def predict_pass(study_hours, attendance, assignments_completed, previous_marks):
data = np.array([[study_hours, attendance, assignments_completed, previous_marks]])
prediction = model.predict(data)[0]
if prediction == 1:
return "โœ… Student Will PASS"
else:
return "โŒ Student Will FAIL"
# Gradio UI
interface = gr.Interface(
fn=predict_pass,
inputs=[
gr.Number(label="Study Hours"),
gr.Number(label="Attendance (%)"),
gr.Number(label="Assignments Completed"),
gr.Number(label="Previous Marks")
],
outputs="text",
title="๐ŸŽ“ Student Pass/Fail Predictor",
description="Predict whether a student will pass based on study hours, attendance, assignments, and previous marks."
)
interface.launch()