Spaces:
Runtime error
Runtime error
Download app.py from hugging2021/CodeFixPro: direct link, hf CLI and curl.
- Browser
- Download file 834 Bytes
-
https://huggingface.co/spaces/hugging2021/CodeFixPro/resolve/51e799a82ecf6bc2d4aa2dcc527d17846d0f3a49/app.py
- Command line
-
hf download hf://spaces/hugging2021/CodeFixPro@51e799a82ecf6bc2d4aa2dcc527d17846d0f3a49/app.py
-
curl -L -o app.py https://huggingface.co/spaces/hugging2021/CodeFixPro/resolve/51e799a82ecf6bc2d4aa2dcc527d17846d0f3a49/app.py
834 Bytes
| import gradio as gr | |
| from agents.error_fixer import fix_code | |
| def process_code(code, prompt): | |
| # Placeholder logic – we'll replace this later | |
| if prompt.lower().strip() == "": | |
| return fix_code(code) | |
| else: | |
| return fix_code(code) + f"\n\n# Prompt modifications not implemented yet" | |
| with gr.Blocks() as demo: | |
| gr.Markdown("## 🧠 CodeFixPro - AI Code Debugger & Modifier Agent") | |
| with gr.Row(): | |
| code_input = gr.Code(label="Paste your code here", language="python", lines=20) | |
| prompt_input = gr.Textbox(label="Enter your prompt (e.g., 'Convert to async')") | |
| run_btn = gr.Button("Fix / Modify Code") | |
| code_output = gr.Code(label="Output Code", language="python", lines=20) | |
| run_btn.click(process_code, inputs=[code_input, prompt_input], outputs=code_output) | |
| demo.launch() |