Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ embedding_model = SentenceTransformer("all-MiniLM-L6-v2")
|
|
| 12 |
|
| 13 |
try:
|
| 14 |
llm = ChatGroq(temperature=0, model="llama3-70b-8192", api_key=GROQ_API_KEY)
|
| 15 |
-
st.success("✅
|
| 16 |
except Exception as e:
|
| 17 |
st.error("❌ Failed to initialize Groq LLM.")
|
| 18 |
traceback.print_exc()
|
|
@@ -82,15 +82,15 @@ def generate_response(user_query, company_ticker, mode, uploaded_file):
|
|
| 82 |
return "Error generating response."
|
| 83 |
|
| 84 |
st.title("📊 AI-Powered Financial Insights Chatbot")
|
| 85 |
-
st.write("Upload financial reports or fetch live financial data
|
| 86 |
|
| 87 |
|
| 88 |
user_query = st.text_input("Enter your query:")
|
| 89 |
-
company_ticker = st.text_input("Enter company ticker symbol
|
| 90 |
mode = st.radio("Select Mode:", ["PDF Upload Mode", "Live Data Mode"])
|
| 91 |
uploaded_file = st.file_uploader("Upload PDF (Only for PDF Mode)", type=["pdf"])
|
| 92 |
|
| 93 |
-
if st.button("
|
| 94 |
if mode == "PDF Upload Mode" and not uploaded_file:
|
| 95 |
st.error("❌ Please upload a PDF file.")
|
| 96 |
else:
|
|
|
|
| 12 |
|
| 13 |
try:
|
| 14 |
llm = ChatGroq(temperature=0, model="llama3-70b-8192", api_key=GROQ_API_KEY)
|
| 15 |
+
st.success("✅ LLM initialized successfully. Using llama3-70b-8192")
|
| 16 |
except Exception as e:
|
| 17 |
st.error("❌ Failed to initialize Groq LLM.")
|
| 18 |
traceback.print_exc()
|
|
|
|
| 82 |
return "Error generating response."
|
| 83 |
|
| 84 |
st.title("📊 AI-Powered Financial Insights Chatbot")
|
| 85 |
+
st.write("Upload financial reports or fetch live financial data ")
|
| 86 |
|
| 87 |
|
| 88 |
user_query = st.text_input("Enter your query:")
|
| 89 |
+
company_ticker = st.text_input("Enter company ticker symbol")
|
| 90 |
mode = st.radio("Select Mode:", ["PDF Upload Mode", "Live Data Mode"])
|
| 91 |
uploaded_file = st.file_uploader("Upload PDF (Only for PDF Mode)", type=["pdf"])
|
| 92 |
|
| 93 |
+
if st.button("Analyze"):
|
| 94 |
if mode == "PDF Upload Mode" and not uploaded_file:
|
| 95 |
st.error("❌ Please upload a PDF file.")
|
| 96 |
else:
|