Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
with open('svm_model.pickle', 'rb') as f:
|
3 |
+
model = pickle.load(f)
|
4 |
+
|
5 |
+
def predfunction(income_group, area_req, nature, budget):
|
6 |
+
income_group = float(income_group)
|
7 |
+
area_req = float(area_req)
|
8 |
+
nature = float(nature)
|
9 |
+
budget = float(budget)
|
10 |
+
testing = [income_group, area_req, nature, budget]
|
11 |
+
X_new = np.array([[income_group, area_req, nature, budget]])
|
12 |
+
prediction = model.predict(X_new)
|
13 |
+
return prediction[0]
|
14 |
+
|
15 |
+
demo = gr.Interface(
|
16 |
+
fn=predfunction,
|
17 |
+
inputs=["text", "text", "text", "text"],
|
18 |
+
outputs=gr.Textbox(label="Best Suited Location For Shop"),
|
19 |
+
)
|
20 |
+
|
21 |
+
demo.launch(inline = False)
|