Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from code_reviewer import review_code
|
| 3 |
+
|
| 4 |
+
st.title("🤖 Code Review Agent (Hugging Face Edition)")
|
| 5 |
+
|
| 6 |
+
code = st.text_area("Paste your code diff or snippet here 👇", height=300)
|
| 7 |
+
|
| 8 |
+
if st.button("Review Code"):
|
| 9 |
+
if code.strip():
|
| 10 |
+
with st.spinner("Analyzing with Hugging Face model..."):
|
| 11 |
+
feedback = review_code(code)
|
| 12 |
+
st.success("Code Review:")
|
| 13 |
+
st.markdown(feedback)
|
| 14 |
+
else:
|
| 15 |
+
st.warning("Please enter some code first.")
|