esteele commited on
Commit
6dbc0f9
·
1 Parent(s): d1ea0c0

test with gradio_client

Browse files
Files changed (1) hide show
  1. app.py +22 -31
app.py CHANGED
@@ -29,39 +29,30 @@ def predict(
29
 
30
  }
31
 
32
- response = client.post(input_dict)
33
 
34
  # r = requests.post(client, json=payload)
35
 
36
  return response
37
- #
38
- #
39
- #
40
- with gr.Blocks() as demo:
41
-
42
- gr.Markdown("# Loan Status Classifier")
43
-
44
- inputs = [
45
- gr.Slider(1000, 100000, label="Loan Original Amount"),
46
- gr.Slider(100, 2000, step=1, label='Credit Score Range (Lower)'),
47
- gr.Slider(1000, 100000, step=10, label="Stated Monthly Income"),
48
- gr.Slider(0, 1000, step=1, label='Number of Investors'),
49
- gr.Slider(20, 5000, step=5, label="Monthly Loan Payment")
50
-
51
- ]
52
-
53
- # a = gr.Slider(1000,100000,label="Loan Amount")
54
- # b = gr.Slider(100,2000,label="Credit Score")
55
- # c = gr.Slider(1000,100000,label="Income")
56
- # d = gr.Slider(0,1000,label="Investors")
57
- # e = gr.Slider(20,5000,label="Monthly Payment")
58
-
59
- output = gr.Textbox()
60
-
61
- btn = gr.Button("Predict")
62
-
63
- # btn.click(predict,[inputs],output)
64
-
65
- gr.Interface(fn=predict, inputs=inputs, outputs=output)
66
 
67
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  }
31
 
32
+ response = client.predict(input_dict)
33
 
34
  # r = requests.post(client, json=payload)
35
 
36
  return response
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
+ inputs = [
39
+ gr.Slider(1000, 100000, label="Loan Original Amount"),
40
+ gr.Slider(100, 2000, step=1, label='Credit Score Range (Lower)'),
41
+ gr.Slider(1000, 100000, step=10, label="Stated Monthly Income"),
42
+ gr.Slider(0, 1000, step=1, label='Number of Investors'),
43
+ gr.Slider(20, 5000, step=5, label="Monthly Loan Payment")
44
+
45
+ ]
46
+ options = ['Current', 'Completed', 'ChargedOff']
47
+ outputs = gr.Label()
48
+ title = "Loan Status Classifier"
49
+ description = (
50
+ "Enter the details of the loan to check the status of the loan."
51
+ )
52
+ gr.Interface(
53
+ fn=predict,
54
+ inputs=inputs,
55
+ outputs=outputs,
56
+ title=title,
57
+ description=description,
58
+ ).launch()