jerrychen428 commited on
Commit
12cc32b
·
verified ·
1 Parent(s): a02bf1b

Update app,py

Browse files
Files changed (1) hide show
  1. app,py +5 -5
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
- # 建立 Gradio 介面
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
- app.launch(share=True, debug=True) # 如果防毒軟體會報錯,請將share=True, debug=True改為share=False
 
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