Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -216,24 +216,24 @@ def main():
|
|
216 |
file_contents=''
|
217 |
next_action=''
|
218 |
for file in all_files:
|
219 |
-
col1, col2, col3, col4, col5 = st.sidebar.columns([6,1,1,1
|
220 |
with col1:
|
221 |
-
st.
|
222 |
-
with col2:
|
223 |
-
if st.button("π", key="read_"+file): # search emoji button
|
224 |
with open(file, 'r') as f:
|
225 |
file_contents = f.read()
|
226 |
-
next_action='
|
|
|
|
|
227 |
with col3:
|
228 |
if st.button("π", key="open_"+file): # open emoji button
|
229 |
with open(file, 'r') as f:
|
230 |
file_contents = f.read()
|
231 |
next_action='open'
|
232 |
with col4:
|
233 |
-
if st.button("
|
234 |
with open(file, 'r') as f:
|
235 |
file_contents = f.read()
|
236 |
-
next_action='
|
237 |
with col5:
|
238 |
if st.button("π", key="delete_"+file):
|
239 |
os.remove(file)
|
@@ -247,7 +247,7 @@ def main():
|
|
247 |
if next_action=='search':
|
248 |
file_content_area = st.text_area("File Contents:", file_contents, height=500)
|
249 |
st.write('Reasoning with your inputs...')
|
250 |
-
response = chat_with_file_contents(file_contents)
|
251 |
st.write('Response:')
|
252 |
st.write(response)
|
253 |
filename = generate_filename(file_content_area, choice)
|
|
|
216 |
file_contents=''
|
217 |
next_action=''
|
218 |
for file in all_files:
|
219 |
+
col1, col2, col3, col4, col5 = st.sidebar.columns([1,6,1,1,1]) # adjust the ratio as needed
|
220 |
with col1:
|
221 |
+
if st.button("π", key="md_"+file): # md emoji button
|
|
|
|
|
222 |
with open(file, 'r') as f:
|
223 |
file_contents = f.read()
|
224 |
+
next_action='md'
|
225 |
+
with col2:
|
226 |
+
st.markdown(get_table_download_link(file), unsafe_allow_html=True)
|
227 |
with col3:
|
228 |
if st.button("π", key="open_"+file): # open emoji button
|
229 |
with open(file, 'r') as f:
|
230 |
file_contents = f.read()
|
231 |
next_action='open'
|
232 |
with col4:
|
233 |
+
if st.button("π", key="read_"+file): # search emoji button
|
234 |
with open(file, 'r') as f:
|
235 |
file_contents = f.read()
|
236 |
+
next_action='search'
|
237 |
with col5:
|
238 |
if st.button("π", key="delete_"+file):
|
239 |
os.remove(file)
|
|
|
247 |
if next_action=='search':
|
248 |
file_content_area = st.text_area("File Contents:", file_contents, height=500)
|
249 |
st.write('Reasoning with your inputs...')
|
250 |
+
response = chat_with_file_contents(user_prompt, file_contents)
|
251 |
st.write('Response:')
|
252 |
st.write(response)
|
253 |
filename = generate_filename(file_content_area, choice)
|