venky2k1 commited on
Commit
63fb23d
ยท
1 Parent(s): 3101b4c

Added Gradio frontend with guide info

Browse files
Files changed (2) hide show
  1. README.md +11 -1
  2. app_ui.py +25 -0
README.md CHANGED
@@ -1 +1,11 @@
1
- "# Bug Fixer Project"
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Bug Fixer
3
+ emoji: ๐Ÿž
4
+ colorFrom: red
5
+ colorTo: blue
6
+ sdk: gradio
7
+ sdk_version: 4.17.0
8
+ app_file: app_ui.py
9
+ pinned: false
10
+ ---
11
+ # Bug Fixer
app_ui.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from bug_detector import detect_bug
3
+ from fix_generator import generate_fix
4
+
5
+ def fix_code(input_code):
6
+ bug = detect_bug(input_code)
7
+ fix = generate_fix(input_code)
8
+ return bug, fix
9
+
10
+ with gr.Blocks() as demo:
11
+ gr.Markdown("## ๐Ÿ› ๏ธ Bug Detection and Fixing Tool")
12
+ gr.Markdown("#### Final Year Project - Guided by: Dr. XYZ <br>Team: Akanksha and Group")
13
+
14
+ with gr.Row():
15
+ code_input = gr.Textbox(label="Enter Buggy Code", lines=8, placeholder="Paste your Python code here...")
16
+
17
+ with gr.Row():
18
+ bug_output = gr.Textbox(label="Detected Bug")
19
+ fix_output = gr.Textbox(label="Suggested Fix")
20
+
21
+ with gr.Row():
22
+ btn = gr.Button("Detect and Fix")
23
+ btn.click(fn=fix_code, inputs=code_input, outputs=[bug_output, fix_output])
24
+
25
+ demo.launch()