Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -90,14 +90,20 @@ def main():
|
|
90 |
|
91 |
candidate_docs = []
|
92 |
if uploaded_file is not None:
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|
102 |
if st.button("Generate Report🗟"):
|
103 |
# Reset timer state so that the timer always shows up
|
|
|
90 |
|
91 |
candidate_docs = []
|
92 |
if uploaded_file is not None:
|
93 |
+
# Check if the file size exceeds 3MB (3 * 1024 * 1024 bytes)
|
94 |
+
if uploaded_file.size > 3 * 1024 * 1024:
|
95 |
+
st.error("The file is too large! Please upload a file smaller than 3MB.")
|
96 |
+
else:
|
97 |
+
try:
|
98 |
+
df = pd.read_csv(uploaded_file)
|
99 |
+
if tweets_column not in df.columns:
|
100 |
+
st.error(f"CSV must contain a '{tweets_column}' column.")
|
101 |
+
else:
|
102 |
+
candidate_docs = df[tweets_column].dropna().astype(str).tolist()
|
103 |
+
# Process your CSV file here...
|
104 |
+
st.write("File uploaded successfully!🎆")
|
105 |
+
except Exception as e:
|
106 |
+
st.error(f"Error reading CSV file: {e}")
|
107 |
|
108 |
if st.button("Generate Report🗟"):
|
109 |
# Reset timer state so that the timer always shows up
|