Download app.py from vipee003/LRModel: direct link, hf CLI and curl.
- Browser
- Download file 579 Bytes
-
https://huggingface.co/spaces/vipee003/LRModel/resolve/main/app.py
- Command line
-
hf download hf://spaces/vipee003/LRModel/app.py
-
curl -L -o app.py https://huggingface.co/spaces/vipee003/LRModel/resolve/main/app.py
579 Bytes
| import pickle as pk | |
| import gradio as gr | |
| import numpy as np | |
| import pandas as pd | |
| from sklearn.linear_model import LinearRegression | |
| loaded_model = pk.load(open("score_predict.pkl", "rb"), encoding="bytes") | |
| def predict_my_score(hours_of_study): | |
| input_arr = [[hours_of_study]] | |
| y_predict_new = loaded_model.predict(input_arr) | |
| return int(y_predict_new[0][0]) | |
| interface = gr.Interface(predict_my_score, title = "Predict My Score ", | |
| description = "Enter the hours you study per day and know your score.", inputs = "number", outputs = | |
| "number") | |
| interface.launch(share = True) |