Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,6 @@ import tempfile
|
|
8 |
import matplotlib.pyplot as plt
|
9 |
|
10 |
# Load environment variables
|
11 |
-
load_dotenv()
|
12 |
openai_api_key = os.getenv("OPENAI_API_KEY")
|
13 |
|
14 |
# Ensure OpenAI API key is provided
|
@@ -21,6 +20,15 @@ llm = OpenAI(api_token=openai_api_key)
|
|
21 |
|
22 |
st.title("Chat with CSV File Using PandasAI")
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
uploaded_file = st.file_uploader("Upload a CSV file", type="csv")
|
25 |
|
26 |
if uploaded_file:
|
@@ -58,10 +66,3 @@ if uploaded_file:
|
|
58 |
|
59 |
except Exception as e:
|
60 |
st.error(f"Error: {e}")
|
61 |
-
|
62 |
-
#st.write("### Instructions")
|
63 |
-
#st.markdown(
|
64 |
-
# "1. Upload a CSV file to get started.\n"
|
65 |
-
# "2. Enter a question to interact with the data.\n"
|
66 |
-
# "3. Enter a query to generate and view graphs.\n"
|
67 |
-
#)
|
|
|
8 |
import matplotlib.pyplot as plt
|
9 |
|
10 |
# Load environment variables
|
|
|
11 |
openai_api_key = os.getenv("OPENAI_API_KEY")
|
12 |
|
13 |
# Ensure OpenAI API key is provided
|
|
|
20 |
|
21 |
st.title("Chat with CSV File Using PandasAI")
|
22 |
|
23 |
+
# Instructions
|
24 |
+
with st.sidebar:
|
25 |
+
st.header("Instructions")
|
26 |
+
st.markdown(
|
27 |
+
"1. Upload a CSV file to get started.\n"
|
28 |
+
"2. Enter a question to interact with the data.\n"
|
29 |
+
"3. Enter a query to generate and view graphs.\n"
|
30 |
+
)
|
31 |
+
|
32 |
uploaded_file = st.file_uploader("Upload a CSV file", type="csv")
|
33 |
|
34 |
if uploaded_file:
|
|
|
66 |
|
67 |
except Exception as e:
|
68 |
st.error(f"Error: {e}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|