ceckenrode commited on
Commit
0310afc
·
1 Parent(s): f10c54a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py CHANGED
@@ -143,6 +143,20 @@ def append_file(file_path, content):
143
  except:
144
  return "Error occurred while appending to file."
145
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
 
147
  title = """<h1 align="center">Memory Chat Story Generator ChatGPT</h1>"""
148
  description = """
 
143
  except:
144
  return "Error occurred while appending to file."
145
 
146
+ # Allow the user to upload a CSV file
147
+ uploaded_file = st.file_uploader("Choose a CSV file", type="csv")
148
+
149
+ # If a file was uploaded, display its contents as a pandas DataFrame
150
+ if uploaded_file is not None:
151
+ data = pd.read_csv(uploaded_file)
152
+ st.write(data)
153
+
154
+ # Add a link to download the CSV file
155
+ st.markdown(f'<a href="data:file/csv;base64,{uploaded_file.getvalue().encode().decode()}">Download CSV File</a>', unsafe_allow_html=True)
156
+
157
+ else:
158
+ st.write("Please upload a CSV file to begin.")
159
+
160
 
161
  title = """<h1 align="center">Memory Chat Story Generator ChatGPT</h1>"""
162
  description = """