File size: 852 Bytes
63fb23d
 
 
 
d57024f
7337ffe
d57024f
 
63fb23d
d57024f
63fb23d
d57024f
 
 
 
 
 
63fb23d
d57024f
 
 
 
 
 
 
 
 
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
28
import gradio as gr
from bug_detector import detect_bug
from fix_generator import generate_fix

def bug_fixer(code):
    bug_status = detect_bug(code)
    fixed_code = generate_fix(code)
    return bug_status, fixed_code

title = "\ud83d\udd27 Bug Detection and Fixing Tool"

with gr.Blocks(theme=gr.themes.Soft()) as demo:
    gr.Markdown("""
        # \ud83d\udd27 Bug Detection and Fixing Tool
        **Final Year Project - Guided by: Prof. Alakananda K P**  
        **Team: Akanksha K P and Divyashree N**
    """)

    code_input = gr.Textbox(lines=8, label="Enter Buggy Code")
    bug_output = gr.Textbox(label="Detected Bug")
    fix_output = gr.Textbox(label="Suggested Fix")
    btn = gr.Button("Detect and Fix")

    btn.click(fn=bug_fixer, inputs=code_input, outputs=[bug_output, fix_output])

demo.launch()
#for the gradio user interface