predictor / app.py
jackenmail's picture
Update app.py
4cbd56f verified
raw
history blame contribute delete
569 Bytes
import joblib
import gradio as gr
import numpy as np
# Load model
model = joblib.load("model.pkl")
# Prediction function
def predict(val1, val2):
try:
data = np.array([[float(val1), float(val2)]])
prediction = model.predict(data)
return "User will select" if prediction[0] == 1 else "User will not select"
except Exception as e:
return f"Error: {str(e)}"
# UI
gr.Interface(
fn=predict,
inputs=[
gr.Number(label="CGPA"),
gr.Number(label="IQ")
],
outputs="text"
).launch()