marcelomoreno26 commited on
Commit
b8c0eaf
1 Parent(s): c469c62

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -10
app.py CHANGED
@@ -15,23 +15,20 @@ def main():
15
  st.markdown("This app summarizes Whatsapp chats and provides named entity recognition as well as sentiment analysis for the conversation")
16
  st.markdown("**NOTE**: *This app can only receive chats downloaded from IOS as the downloaded chat format is different than from Android.*")
17
  st.markdown("Download your whatsapp chat by going to Settings > Chats > Export Chat and there select the chat you want to summarize (download 'Without Media').")
18
-
19
 
20
- # File uploader
21
- uploaded_file = st.file_uploader("Choose a file (.zip)", type=['zip'])
22
-
23
- st.markdown("**Example Files**: Select an example file to analyze:")
24
  example_files = {
25
  "Example 1": "example1.zip",
26
  "Example 2": "example2.zip",
27
  "Example 3": "example3.zip"
28
  }
29
- selected_example = st.selectbox("", list(example_files.keys()))
 
 
30
 
31
- if selected_example:
32
- file_path = example_files[selected_example]
33
- with open(file_path, "rb") as f:
34
- uploaded_file = f.read()
35
 
36
  if uploaded_file is not None:
37
  file_type = detect_file_type(uploaded_file.name)
 
15
  st.markdown("This app summarizes Whatsapp chats and provides named entity recognition as well as sentiment analysis for the conversation")
16
  st.markdown("**NOTE**: *This app can only receive chats downloaded from IOS as the downloaded chat format is different than from Android.*")
17
  st.markdown("Download your whatsapp chat by going to Settings > Chats > Export Chat and there select the chat you want to summarize (download 'Without Media').")
 
18
 
19
+ st.markdown("**Example Files**: Download example zip files to test the app:")
 
 
 
20
  example_files = {
21
  "Example 1": "example1.zip",
22
  "Example 2": "example2.zip",
23
  "Example 3": "example3.zip"
24
  }
25
+ for name, file in example_files.items():
26
+ with open(file, "rb") as f:
27
+ st.download_button(label=name, data=f, file_name=file, mime="application/zip")
28
 
29
+
30
+ # File uploader
31
+ uploaded_file = st.file_uploader("Choose a file (.zip)", type=['zip'])
 
32
 
33
  if uploaded_file is not None:
34
  file_type = detect_file_type(uploaded_file.name)