Spaces:
Runtime error
Runtime error
Download app.py from mrzaeem102/Data-Classification: direct link, hf CLI and curl.
- Browser
- Download file 640 Bytes
-
https://huggingface.co/spaces/mrzaeem102/Data-Classification/resolve/main/app.py
- Command line
-
hf download hf://spaces/mrzaeem102/Data-Classification/app.py
-
curl -L -o app.py https://huggingface.co/spaces/mrzaeem102/Data-Classification/resolve/main/app.py
640 Bytes
| 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) |