sumit12 commited on
Commit
c8137ae
·
1 Parent(s): a6d9414

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -0
app.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import pickle
3
+ import gradio as gr
4
+ import numpy as np
5
+
6
+ model=pickle.load(open('model1.pkl','rb'))
7
+
8
+ a1= gr.Number(label='Unit of Measure (Per Pack)')
9
+ a2= gr.Number(label='Line Item Quantity')
10
+ a3= gr.Number(label='Line Item Value')
11
+ a4= gr.Number(label='Weight (Kilograms)')
12
+ a5= gr.Number(label='Freight Cost (USD)')
13
+ a6= gr.Number(label='Line Item Insurance (USD)')
14
+
15
+ def predict_pack_price(a1,a2,a3,a4,a5,a6):
16
+ input_array=np.array([[a1,a2,a3,a4,a5,a6]])
17
+ pred=model.predict(input_array)
18
+ print(pred)
19
+ return pred
20
+
21
+ # def predict_unit_price(a1,a2,a3,a4,a5,a6):
22
+ # input_array=np.array([[a1,a2,a3,a4,a5,a6]])
23
+ # pred=clf2.predict(input_array)
24
+ # return pred
25
+
26
+ # outputs1=gr.outputs.Textbox()
27
+ # outputs2=gr.outputs.Textbox()
28
+ demo1 =gr.Interface(fn=predict_pack_price,inputs=['number','number','number','number','number','number'],outputs='number',description='PACK PRICE')
29
+ # demo2 =gr.Interface(fn=predict_unit_price,inputs=[a1,a2,a3,a4,a5,a6],outputs=outputs2,description="UNIT PRICE")
30
+
31
+ demo1.launch(share=True)