esteele commited on
Commit
c269f23
·
verified ·
1 Parent(s): 2346d6a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -15
app.py CHANGED
@@ -1,17 +1,9 @@
1
- import gradio as gr
2
  from gradio_client import Client
3
 
4
- # from huggingface_hub import InferenceClient
5
- # API_URL = "https://api-inference.huggingface.co/models/esteele/carlas-loan-classifier-model"
6
- client = Client("esteele/carlas-loan-classifier-model")
7
- #
8
 
9
- # def greet(name):
10
- # return "Hello " + name + "!!"
11
- #
12
- #
13
- # inface = gr.Interface(fn=greet, inputs="text", outputs="text")
14
- # inface.launch()
15
 
16
  def predict(
17
  loan_original_amount,
@@ -29,9 +21,7 @@ def predict(
29
 
30
  }
31
 
32
- response = client.predict(input_dict)
33
-
34
- # r = requests.post(client, json=payload)
35
 
36
  return response
37
 
@@ -55,4 +45,4 @@ gr.Interface(
55
  outputs=outputs,
56
  title=title,
57
  description=description,
58
- ).launch()
 
1
+ import joblib
2
  from gradio_client import Client
3
 
4
+ model = joblib.load("loan_status_classifier_pipeline.joblib")
5
+ asyncio.set_event_loop_policy(asyncio.DefaultEventLoopPolicy())
 
 
6
 
 
 
 
 
 
 
7
 
8
  def predict(
9
  loan_original_amount,
 
21
 
22
  }
23
 
24
+ response = model.predict(input_dict)
 
 
25
 
26
  return response
27
 
 
45
  outputs=outputs,
46
  title=title,
47
  description=description,
48
+ ).launch(share=True)