Spaces:
Runtime error
Runtime error
venky2k1
commited on
Commit
Β·
6e3deff
1
Parent(s):
eef3533
Final working bug fixer with fixed detection and suggestion
Browse files- README.md +1 -1
- app_ui.py +3 -3
- fix_generator.py +3 -2
README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
---
|
2 |
title: Bug Fixer
|
3 |
-
emoji:
|
4 |
colorFrom: red
|
5 |
colorTo: blue
|
6 |
sdk: gradio
|
|
|
1 |
---
|
2 |
title: Bug Fixer
|
3 |
+
emoji: "π§"
|
4 |
colorFrom: red
|
5 |
colorTo: blue
|
6 |
sdk: gradio
|
app_ui.py
CHANGED
@@ -7,11 +7,11 @@ def bug_fixer(code):
|
|
7 |
fixed_code = generate_fix(code)
|
8 |
return bug_status, fixed_code
|
9 |
|
10 |
-
title = "
|
11 |
|
12 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
13 |
gr.Markdown("""
|
14 |
-
#
|
15 |
**Final Year Project - Guided by: Prof. Alakananda K P**
|
16 |
**Team: Akanksha K P and Divyashree N**
|
17 |
""")
|
@@ -23,5 +23,5 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
23 |
|
24 |
btn.click(fn=bug_fixer, inputs=code_input, outputs=[bug_output, fix_output])
|
25 |
|
26 |
-
demo.launch()
|
27 |
#for the gradio user interface
|
|
|
7 |
fixed_code = generate_fix(code)
|
8 |
return bug_status, fixed_code
|
9 |
|
10 |
+
title = "π§ Bug Detection and Fixing Tool"
|
11 |
|
12 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
13 |
gr.Markdown("""
|
14 |
+
# π§ Bug Detection and Fixing Tool
|
15 |
**Final Year Project - Guided by: Prof. Alakananda K P**
|
16 |
**Team: Akanksha K P and Divyashree N**
|
17 |
""")
|
|
|
23 |
|
24 |
btn.click(fn=bug_fixer, inputs=code_input, outputs=[bug_output, fix_output])
|
25 |
|
26 |
+
demo.launch(share=True)
|
27 |
#for the gradio user interface
|
fix_generator.py
CHANGED
@@ -2,8 +2,9 @@ def generate_fix(code):
|
|
2 |
lines = code.split("\n")
|
3 |
fixed_lines = []
|
4 |
for line in lines:
|
5 |
-
|
6 |
-
|
|
|
7 |
fixed_lines.append(f"print({content})")
|
8 |
else:
|
9 |
fixed_lines.append(line)
|
|
|
2 |
lines = code.split("\n")
|
3 |
fixed_lines = []
|
4 |
for line in lines:
|
5 |
+
line = line.strip()
|
6 |
+
if line.startswith("print ") and not line.startswith("print("):
|
7 |
+
content = line[6:].strip()
|
8 |
fixed_lines.append(f"print({content})")
|
9 |
else:
|
10 |
fixed_lines.append(line)
|