Update app,py
Browse files
app,py
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
# app.py
|
|
|
2 |
from Fraud_Detection_BERT_grado_6 import FinancialFraudTrainer
|
3 |
|
|
|
4 |
trainer = FinancialFraudTrainer()
|
5 |
trainer.load_saved_model()
|
6 |
|
7 |
-
#
|
8 |
-
import gradio as gr
|
9 |
-
|
10 |
app = gr.Interface(
|
11 |
-
fn=predict_transaction,
|
12 |
inputs=gr.Textbox(lines=3, placeholder="輸入交易簡訊..."),
|
13 |
outputs="text",
|
14 |
title="💳 中英文詐騙簡訊判斷器",
|
@@ -16,4 +16,4 @@ app = gr.Interface(
|
|
16 |
)
|
17 |
|
18 |
if __name__ == "__main__":
|
19 |
-
|
|
|
1 |
# app.py
|
2 |
+
import gradio as gr
|
3 |
from Fraud_Detection_BERT_grado_6 import FinancialFraudTrainer
|
4 |
|
5 |
+
# 初始化模型
|
6 |
trainer = FinancialFraudTrainer()
|
7 |
trainer.load_saved_model()
|
8 |
|
9 |
+
# Gradio 介面
|
|
|
|
|
10 |
app = gr.Interface(
|
11 |
+
fn=trainer.predict_transaction,
|
12 |
inputs=gr.Textbox(lines=3, placeholder="輸入交易簡訊..."),
|
13 |
outputs="text",
|
14 |
title="💳 中英文詐騙簡訊判斷器",
|
|
|
16 |
)
|
17 |
|
18 |
if __name__ == "__main__":
|
19 |
+
app.launch(share=True, debug=True) # ✅ 真正啟動 Gradio App
|