Spaces:
Runtime error
Runtime error
Download app.py from nandunelapatla/CodeMentorAI: direct link, hf CLI and curl.
- Browser
- Download file 772 Bytes
-
https://huggingface.co/spaces/nandunelapatla/CodeMentorAI/resolve/main/app.py
- Command line
-
hf download hf://spaces/nandunelapatla/CodeMentorAI/app.py
-
curl -L -o app.py https://huggingface.co/spaces/nandunelapatla/CodeMentorAI/resolve/main/app.py
772 Bytes
| import streamlit as st | |
| from backend import explain_code, debug_code, ask_question | |
| st.set_page_config(page_title="CodeMentor AI", layout="wide") | |
| st.title("🤖 CodeMentor AI") | |
| tab1, tab2, tab3 = st.tabs(["Explain Code", "Fix Code", "Ask AI"]) | |
| with tab1: | |
| code = st.text_area("Paste your Python code") | |
| if st.button("Explain Code"): | |
| with st.spinner("Explaining..."): | |
| st.success(explain_code(code)) | |
| with tab2: | |
| code = st.text_area("Paste code to debug") | |
| if st.button("Fix Code"): | |
| with st.spinner("Analyzing..."): | |
| st.success(debug_code(code)) | |
| with tab3: | |
| question = st.text_input("Ask your question") | |
| if st.button("Ask AI"): | |
| with st.spinner("Thinking..."): | |
| st.success(ask_question(question)) |