File size: 680 Bytes
d77c194
aabb9c5
d77c194
aabb9c5
 
 
 
 
 
 
 
 
 
 
 
 
d77c194
88b524e
aabb9c5
88b524e
 
 
aabb9c5
88b524e
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import gradio as gr
import subprocess

def run_pipeline():
    try:
        result = subprocess.run(
            ["python", "src/train.py"],
            capture_output=True,
            text=True
        )
        if result.returncode == 0:
            return "Pipeline executed successfully:\n\n" + result.stdout
        else:
            return "Pipeline failed:\n\n" + result.stderr
    except Exception as e:
        return str(e)

demo = gr.Interface(
    fn=run_pipeline,
    inputs=[],
    outputs="text",
    title="Credit Card Fraud Detection with DuckDB",
    description="Click Generate to run the DuckDB Medallion pipeline and train the fraud model."
)

demo.launch()