Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,9 @@
|
|
| 1 |
-
import
|
| 2 |
from gradio_client import Client
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 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 =
|
| 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)
|