Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,11 +43,11 @@ llm_judge.verbose = True
|
|
| 43 |
rag_llm.verbose = True
|
| 44 |
|
| 45 |
# ----------------- PDF Selection (Upload or URL) -----------------
|
| 46 |
-
st.
|
| 47 |
pdf_source = st.radio("Choose a PDF source:", ["Upload a PDF file", "Enter a PDF URL"], index=0, horizontal=True)
|
| 48 |
|
| 49 |
if pdf_source == "Upload a PDF file":
|
| 50 |
-
uploaded_file = st.
|
| 51 |
if uploaded_file:
|
| 52 |
st.session_state.pdf_path = "temp.pdf"
|
| 53 |
with open(st.session_state.pdf_path, "wb") as f:
|
|
@@ -57,7 +57,7 @@ if pdf_source == "Upload a PDF file":
|
|
| 57 |
st.session_state.vector_created = False
|
| 58 |
|
| 59 |
elif pdf_source == "Enter a PDF URL":
|
| 60 |
-
pdf_url = st.
|
| 61 |
if pdf_url and not st.session_state.pdf_loaded:
|
| 62 |
with st.spinner("π Downloading PDF..."):
|
| 63 |
try:
|
|
|
|
| 43 |
rag_llm.verbose = True
|
| 44 |
|
| 45 |
# ----------------- PDF Selection (Upload or URL) -----------------
|
| 46 |
+
st.subheader("π PDF Selection")
|
| 47 |
pdf_source = st.radio("Choose a PDF source:", ["Upload a PDF file", "Enter a PDF URL"], index=0, horizontal=True)
|
| 48 |
|
| 49 |
if pdf_source == "Upload a PDF file":
|
| 50 |
+
uploaded_file = st.file_uploader("Upload your PDF file", type=["pdf"])
|
| 51 |
if uploaded_file:
|
| 52 |
st.session_state.pdf_path = "temp.pdf"
|
| 53 |
with open(st.session_state.pdf_path, "wb") as f:
|
|
|
|
| 57 |
st.session_state.vector_created = False
|
| 58 |
|
| 59 |
elif pdf_source == "Enter a PDF URL":
|
| 60 |
+
pdf_url = st.text_input("Enter PDF URL:")
|
| 61 |
if pdf_url and not st.session_state.pdf_loaded:
|
| 62 |
with st.spinner("π Downloading PDF..."):
|
| 63 |
try:
|