SandeepU commited on
Commit
0e1c86c
·
verified ·
1 Parent(s): db97ee5

Upload 3 files

Browse files
Files changed (2) hide show
  1. README.md +4 -4
  2. streamlit_app.py +3 -3
README.md CHANGED
@@ -9,11 +9,11 @@ app_file: streamlit_app.py
9
  pinned: false
10
  ---
11
 
12
- # 🧠 Code Explainer (CodeT5-base Summarizer)
13
 
14
- This app uses `Salesforce/codet5-base-multi-sum`, a model fine-tuned for code summarization.
15
 
16
  ## How to Use
17
- 1. Paste Python code in the input box.
18
  2. Click "Explain".
19
- 3. View the AI-generated explanation of what the function does.
 
9
  pinned: false
10
  ---
11
 
12
+ # 🧠 Code Explainer (Final - CodeT5-base)
13
 
14
+ This app uses `Salesforce/codet5-base-multi-sum` with optimized prompts for generating docstring-like explanations of Python code.
15
 
16
  ## How to Use
17
+ 1. Paste your Python code.
18
  2. Click "Explain".
19
+ 3. Get a plain English explanation generated by an AI model.
streamlit_app.py CHANGED
@@ -3,8 +3,8 @@ from model.model_utils import load_model, generate_explanation
3
 
4
  st.set_page_config(page_title="Code Explainer", layout="centered")
5
 
6
- st.title("🧠 Code Explainer (CodeT5-base Summarizer)")
7
- st.write("Paste your Python code below and get a natural language explanation:")
8
 
9
  code_input = st.text_area("Paste Python Code", height=200)
10
 
@@ -12,7 +12,7 @@ if st.button("Explain"):
12
  if code_input.strip():
13
  with st.spinner("Generating explanation..."):
14
  tokenizer, model = load_model()
15
- explanation = generate_explanation(code_input, tokenizer, model)
16
  st.subheader("✅ Explanation")
17
  st.write(explanation)
18
  else:
 
3
 
4
  st.set_page_config(page_title="Code Explainer", layout="centered")
5
 
6
+ st.title("🧠 Code Explainer (Final - CodeT5-base)")
7
+ st.write("Paste your Python code below and get a high-quality explanation:")
8
 
9
  code_input = st.text_area("Paste Python Code", height=200)
10
 
 
12
  if code_input.strip():
13
  with st.spinner("Generating explanation..."):
14
  tokenizer, model = load_model()
15
+ explanation = generate_explanation(code_input.strip(), tokenizer, model)
16
  st.subheader("✅ Explanation")
17
  st.write(explanation)
18
  else: