Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +4 -4
src/streamlit_app.py
CHANGED
|
@@ -12,7 +12,7 @@ os.environ["GROQ_API_KEY"] = "gsk_aGQGHasoigRaBoLyVadPWGdyb3FYxt6aMrzZEdCjA8QLGh
|
|
| 12 |
# Page config
|
| 13 |
st.set_page_config(page_title="📄 Chat with PDF", layout="wide")
|
| 14 |
|
| 15 |
-
#
|
| 16 |
bg_color = "#f0f2f6"
|
| 17 |
app_bg = "rgba(255, 255, 255, 0.6)"
|
| 18 |
sidebar_bg = "rgba(255, 255, 255, 0.9)"
|
|
@@ -20,7 +20,7 @@ text_color = "#000000"
|
|
| 20 |
input_bg = "rgba(240, 240, 240, 0.9)"
|
| 21 |
accent_color = "#2AA198"
|
| 22 |
|
| 23 |
-
#
|
| 24 |
st.markdown(f"""
|
| 25 |
<style>
|
| 26 |
body {{
|
|
@@ -96,7 +96,7 @@ with st.sidebar:
|
|
| 96 |
st.write("Then ask your question below!")
|
| 97 |
|
| 98 |
# Main UI
|
| 99 |
-
st.markdown(f"<h1 style='text-align:center;'>
|
| 100 |
|
| 101 |
if file is not None:
|
| 102 |
pdf_pages = PdfReader(file)
|
|
@@ -104,7 +104,7 @@ if file is not None:
|
|
| 104 |
for page in pdf_pages.pages:
|
| 105 |
text += page.extract_text()
|
| 106 |
|
| 107 |
-
# Split
|
| 108 |
text_splitter = RecursiveCharacterTextSplitter(
|
| 109 |
separators=["\n"],
|
| 110 |
chunk_size=1000,
|
|
|
|
| 12 |
# Page config
|
| 13 |
st.set_page_config(page_title="📄 Chat with PDF", layout="wide")
|
| 14 |
|
| 15 |
+
#theme
|
| 16 |
bg_color = "#f0f2f6"
|
| 17 |
app_bg = "rgba(255, 255, 255, 0.6)"
|
| 18 |
sidebar_bg = "rgba(255, 255, 255, 0.9)"
|
|
|
|
| 20 |
input_bg = "rgba(240, 240, 240, 0.9)"
|
| 21 |
accent_color = "#2AA198"
|
| 22 |
|
| 23 |
+
# CSS
|
| 24 |
st.markdown(f"""
|
| 25 |
<style>
|
| 26 |
body {{
|
|
|
|
| 96 |
st.write("Then ask your question below!")
|
| 97 |
|
| 98 |
# Main UI
|
| 99 |
+
st.markdown(f"<h1 style='text-align:center;'>✨ Chat With Your PDF</h1>", unsafe_allow_html=True)
|
| 100 |
|
| 101 |
if file is not None:
|
| 102 |
pdf_pages = PdfReader(file)
|
|
|
|
| 104 |
for page in pdf_pages.pages:
|
| 105 |
text += page.extract_text()
|
| 106 |
|
| 107 |
+
# Split into chunks
|
| 108 |
text_splitter = RecursiveCharacterTextSplitter(
|
| 109 |
separators=["\n"],
|
| 110 |
chunk_size=1000,
|