svsaurav95 commited on
Commit
f3742ca
Β·
verified Β·
1 Parent(s): 82e8790

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -12,7 +12,7 @@ from langchain_groq import ChatGroq
12
  import torch
13
  import os
14
 
15
- st.set_page_config(page_title="FinQuery RAG bot", page_icon="πŸ“Š", layout="wide")
16
 
17
  device = "cuda" if torch.cuda.is_available() else "cpu"
18
 
@@ -119,7 +119,7 @@ def generate_response(user_query, pdf_ticker, ai_ticker, mode, uploaded_file):
119
  return "Error generating response."
120
 
121
  st.markdown(
122
- "<h1 style='text-align: center; color: #4CAF50;'>πŸ“„ FinQuery RAG bot</h1>",
123
  unsafe_allow_html=True
124
  )
125
  st.markdown(
@@ -149,7 +149,7 @@ else:
149
  uploaded_file = None
150
  pdf_ticker = None
151
 
152
- if st.button("Analyze Now"):
153
  if mode == "πŸ“„ PDF Upload Mode" and (not uploaded_file or not pdf_ticker):
154
  st.error("❌ Please upload a PDF and enter a company ticker for insights.")
155
  elif mode == "🌍 Live Data Mode" and not ai_ticker:
@@ -159,7 +159,15 @@ if st.button("Analyze Now"):
159
  response = generate_response(user_query, pdf_ticker, ai_ticker, mode, uploaded_file)
160
  st.markdown("---")
161
  st.markdown("<h3 style='color: #4CAF50;'>πŸ’‘ AI Response</h3>", unsafe_allow_html=True)
162
- st.write(response)
 
 
 
 
 
 
 
 
 
163
 
164
  st.markdown("---")
165
-
 
12
  import torch
13
  import os
14
 
15
+ st.set_page_config(page_title="Financial Insights Chatbot", page_icon="πŸ“Š", layout="wide")
16
 
17
  device = "cuda" if torch.cuda.is_available() else "cpu"
18
 
 
119
  return "Error generating response."
120
 
121
  st.markdown(
122
+ "<h1 style='text-align: center; color: #4CAF50;'>πŸ“Š AI-Powered Financial Insights Chatbot</h1>",
123
  unsafe_allow_html=True
124
  )
125
  st.markdown(
 
149
  uploaded_file = None
150
  pdf_ticker = None
151
 
152
+ if st.button("πŸš€ Analyze Now"):
153
  if mode == "πŸ“„ PDF Upload Mode" and (not uploaded_file or not pdf_ticker):
154
  st.error("❌ Please upload a PDF and enter a company ticker for insights.")
155
  elif mode == "🌍 Live Data Mode" and not ai_ticker:
 
159
  response = generate_response(user_query, pdf_ticker, ai_ticker, mode, uploaded_file)
160
  st.markdown("---")
161
  st.markdown("<h3 style='color: #4CAF50;'>πŸ’‘ AI Response</h3>", unsafe_allow_html=True)
162
+
163
+ # πŸ“Œ AI Response Box with Styling
164
+ st.markdown(
165
+ f"""
166
+ <div style="border: 1px solid #444; padding: 15px; background-color: #f7f7f7; border-radius: 10px;">
167
+ <p style="color: #222; font-size: 16px;">{response}</p>
168
+ </div>
169
+ """,
170
+ unsafe_allow_html=True
171
+ )
172
 
173
  st.markdown("---")