Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import joblib
|
| 2 |
+
import pandas
|
| 3 |
+
from sklearn import model_selection
|
| 4 |
+
import gradio as gr
|
| 5 |
+
|
| 6 |
+
def greet(one,two, three, four, five, six, seven, eight):
|
| 7 |
+
# load the model from disk
|
| 8 |
+
loaded_model = joblib.load('/content/finalized_model.sav')
|
| 9 |
+
result = loaded_model.predict([[float(one),float(two), float(three), float(four), float(five), float(six), float(seven), float(eight)]])
|
| 10 |
+
return str(result)
|
| 11 |
+
|
| 12 |
+
demo = gr.Interface(
|
| 13 |
+
fn=greet,
|
| 14 |
+
inputs=[
|
| 15 |
+
gr.Textbox(label="one"),
|
| 16 |
+
gr.Textbox(label="two"),
|
| 17 |
+
gr.Textbox(label="three"),
|
| 18 |
+
gr.Textbox(label="four"),
|
| 19 |
+
gr.Textbox(label="five"),
|
| 20 |
+
gr.Textbox(label="six"),
|
| 21 |
+
gr.Textbox(label="seven"),
|
| 22 |
+
gr.Textbox(label="eight"),
|
| 23 |
+
|
| 24 |
+
],
|
| 25 |
+
outputs="text",
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
demo.launch(debug=True)
|