Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- streamlit_app.py +3 -3
streamlit_app.py
CHANGED
@@ -3,7 +3,7 @@ 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 (
|
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)
|
@@ -11,8 +11,8 @@ code_input = st.text_area("Paste Python Code", height=200)
|
|
11 |
if st.button("Explain"):
|
12 |
if code_input.strip():
|
13 |
with st.spinner("Generating explanation..."):
|
14 |
-
tokenizer, 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 (CodeT5-small)")
|
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)
|
|
|
11 |
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:
|