Spaces:
Sleeping
Sleeping
Delete streamlit_app.py
Browse files- streamlit_app.py +0 -19
streamlit_app.py
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
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-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)
|
| 10 |
-
|
| 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:
|
| 19 |
-
st.warning("Please paste some code to explain.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|