Update app.py
Browse files
app.py
CHANGED
@@ -10,8 +10,11 @@ from groq import Groq
|
|
10 |
from pydantic import BaseModel, Field
|
11 |
from typing import Dict, List, Optional
|
12 |
from langchain.tools import tool
|
13 |
-
from langchain.agents import initialize_agent, AgentType
|
14 |
from scipy.stats import ttest_ind, f_oneway
|
|
|
|
|
|
|
15 |
|
16 |
# Initialize Groq Client
|
17 |
client = Groq(api_key=os.environ.get("GROQ_API_KEY"))
|
@@ -217,8 +220,11 @@ def main():
|
|
217 |
uploaded_file = st.file_uploader("Upload research dataset", type=["csv", "parquet"])
|
218 |
if uploaded_file:
|
219 |
with st.spinner("Initializing dataset..."):
|
220 |
-
|
221 |
-
|
|
|
|
|
|
|
222 |
|
223 |
# Main research interface
|
224 |
if st.session_state.data is not None:
|
|
|
10 |
from pydantic import BaseModel, Field
|
11 |
from typing import Dict, List, Optional
|
12 |
from langchain.tools import tool
|
13 |
+
from langchain.agents import initialize_agent, AgentType # You are not using this!
|
14 |
from scipy.stats import ttest_ind, f_oneway
|
15 |
+
from statsmodels.tsa.seasonal import seasonal_decompose # For temporal Analysis
|
16 |
+
from statsmodels.tsa.stattools import adfuller # For temporal Analysis
|
17 |
+
from langchain.prompts import PromptTemplate # For groq LLM
|
18 |
|
19 |
# Initialize Groq Client
|
20 |
client = Groq(api_key=os.environ.get("GROQ_API_KEY"))
|
|
|
220 |
uploaded_file = st.file_uploader("Upload research dataset", type=["csv", "parquet"])
|
221 |
if uploaded_file:
|
222 |
with st.spinner("Initializing dataset..."):
|
223 |
+
try:
|
224 |
+
st.session_state.data = pd.read_csv(uploaded_file)
|
225 |
+
st.success(f"Loaded {len(st.session_state.data):,} research observations")
|
226 |
+
except Exception as e:
|
227 |
+
st.error(f"Error loading dataset: {e}")
|
228 |
|
229 |
# Main research interface
|
230 |
if st.session_state.data is not None:
|