harish199 commited on
Commit
6e92684
1 Parent(s): 1b0a625

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -6
app.py CHANGED
@@ -80,7 +80,7 @@ def credit_run(person_age, person_emp_length,person_home_ownership,cb_person_def
80
  return "High risk of defaulting" if out[0] == 1 else "Low risk of defaulting"
81
 
82
  import gradio as gr
83
- with gr.Blocks(title="Non_Payment_Risk_Predictor", theme=gr.themes.Soft()) as demo:
84
  with gr.Row():
85
  with gr.Column(scale=1,min_width=400):
86
  gr.Image("Non_Payment_Logo.png").style(height='5')
@@ -115,9 +115,15 @@ with gr.Blocks(title="Non_Payment_Risk_Predictor", theme=gr.themes.Soft()) as de
115
  default= gr.Radio(['Low risk of defaulting', 'High risk of defaulting'],label="Chances Of Defaulting")
116
 
117
  btn = gr.Button("PREDICT")
118
- gr.title= "Non Payment Risk Predictor"
119
- gr.themes.Soft()
120
- #gr.Examples
121
- btn.click(fn=credit_run, inputs=[person_age,Person_Income,Home_Ownership_Status,Person_Emp_Length,Credit_Intent,Type_Of_Credit,Credit_Amount,Interest_Rate,Person_Defaulted_in_History,Person_Credit_History_Length], outputs=[default])
122
- #gr.Examples(inputs=[person_age,Pererson_Emp_Length,Home_Ownership_Status,Person_Defaulted_in_History,Credit_Intent,Type_Of_Credit,Person_Income,Loan_Amount,Loan_Interest_Rate,Person_Credit_History_Length])
 
 
 
 
 
 
123
  demo.launch(debug=True)
 
80
  return "High risk of defaulting" if out[0] == 1 else "Low risk of defaulting"
81
 
82
  import gradio as gr
83
+ with gr.Blocks(theme=gr.themes.Soft()) as demo:
84
  with gr.Row():
85
  with gr.Column(scale=1,min_width=400):
86
  gr.Image("Non_Payment_Logo.png").style(height='5')
 
115
  default= gr.Radio(['Low risk of defaulting', 'High risk of defaulting'],label="Chances Of Defaulting")
116
 
117
  btn = gr.Button("PREDICT")
118
+ btn.click(fn=credit_run, inputs=[person_age,Person_Emp_Length,Home_Ownership_Status,Person_Defaulted_in_History,Credit_Intent,Type_Of_Credit,Person_Income,Loan_Amount,Loan_Interest_Rate,Person_Credit_History_Length], outputs=[default])
119
+ gr.Examples(
120
+ [["23","2","RENT","N","EDUCATION","A","12000","30000","8.9","6"],
121
+ ["35","10","OWN","N","MEDICAL","C","20000","40000","8.3","8"],
122
+ ["28","6","RENT","N","VENTURE","B","32000","30000","8.2","6"],
123
+ ["32","10","MORTGAGE","Y","HOMEIMPROVEMENT","E","20000","60000","8.6","8"],
124
+ ["41","18","OWN","Y","PERSONAL","A","10000","300000","14.3","4"],
125
+ ["30","7","OTHER","Y","MEDICAL","C","20000","1000000","7.5","10"],
126
+
127
+ inputs=[person_age,Person_Emp_Length,Home_Ownership_Status,Person_Defaulted_in_History,Credit_Intent,Type_Of_Credit,Person_Income,Loan_Amount,Loan_Interest_Rate,Person_Credit_History_Length]
128
+ )
129
  demo.launch(debug=True)