Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from predict import predict_transaction
|
3 |
+
|
4 |
+
def predict_ui(check_id, employee_id, total, discount_amount, item_count, time, terminal_id):
|
5 |
+
return predict_transaction({
|
6 |
+
"check_id": check_id,
|
7 |
+
"employee_id": employee_id,
|
8 |
+
"total": total,
|
9 |
+
"discount_amount": discount_amount,
|
10 |
+
"item_count": item_count,
|
11 |
+
"time": time,
|
12 |
+
"terminal_id": terminal_id
|
13 |
+
})
|
14 |
+
|
15 |
+
demo = gr.Interface(
|
16 |
+
fn=predict_ui,
|
17 |
+
inputs=["number", "text", "number", "number", "number", "text", "text"],
|
18 |
+
outputs="text",
|
19 |
+
title="Suspicious Transaction Detector"
|
20 |
+
)
|
21 |
+
|
22 |
+
demo.launch()
|