DrishtiSharma commited on
Commit
46133c4
·
verified ·
1 Parent(s): f615ebf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -20,7 +20,7 @@ llm = OpenAI(api_token=openai_api_key)
20
  # Chat with CSV
21
  def chat_with_csv(df, prompt):
22
  pandas_ai = SmartDataframe(df, config={"llm": llm})
23
- result = pandas_ai.run(df, prompt=prompt)
24
  return result
25
 
26
  # Dataset loading without caching to support progress bar
@@ -117,6 +117,7 @@ if "df" in st.session_state and not st.session_state.df.empty:
117
  if st.session_state.user_query.strip():
118
  with st.spinner("Processing your query..."):
119
  try:
 
120
  result = chat_with_csv(st.session_state.df, st.session_state.user_query)
121
  st.success(result)
122
  except Exception as e:
 
20
  # Chat with CSV
21
  def chat_with_csv(df, prompt):
22
  pandas_ai = SmartDataframe(df, config={"llm": llm})
23
+ result = pandas_ai.chat(prompt) # FIX: Use `chat` instead of `run`
24
  return result
25
 
26
  # Dataset loading without caching to support progress bar
 
117
  if st.session_state.user_query.strip():
118
  with st.spinner("Processing your query..."):
119
  try:
120
+ # FIX: Use the correct `chat` method
121
  result = chat_with_csv(st.session_state.df, st.session_state.user_query)
122
  st.success(result)
123
  except Exception as e: