Spaces:
Runtime error
Runtime error
File size: 640 Bytes
7c34082 a8cfa38 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | import gradio as gr
import joblib
model = joblib.load("iris_model.pkl")
classes = ["Setosa", "Versicolor", "Virginica"]
def predict_flower(sl, sw, pl, pw):
pred = model.predict([[sl, sw, pl, pw]])
return classes[pred[0]]
demo = gr.Interface(
fn=predict_flower,
inputs=[
gr.Number(label="Sepal Length"),
gr.Number(label="Sepal Width"),
gr.Number(label="Petal Length"),
gr.Number(label="Petal Width")
],
outputs="text",
title="Iris Flower Classification AI",
description="Predict flower species using Machine Learning"
)
demo.launch(server_name="0.0.0.0", server_port=7860) |