Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -659,7 +659,6 @@ def main():
|
|
659 |
with open(file, 'r') as f:
|
660 |
file_contents = f.read()
|
661 |
next_action='md'
|
662 |
-
addDocumentHTML5(file_contents)
|
663 |
with col2:
|
664 |
st.markdown(get_table_download_link(file), unsafe_allow_html=True)
|
665 |
with col3:
|
@@ -667,30 +666,34 @@ def main():
|
|
667 |
with open(file, 'r') as f:
|
668 |
file_contents = f.read()
|
669 |
next_action='open'
|
670 |
-
addDocumentHTML5(file_contents)
|
671 |
with col4:
|
672 |
if st.button("🔍", key="read_"+file): # search emoji button
|
673 |
with open(file, 'r') as f:
|
674 |
file_contents = f.read()
|
675 |
next_action='search'
|
676 |
-
addDocumentHTML5(file_contents)
|
677 |
with col5:
|
678 |
if st.button("🗑", key="delete_"+file):
|
679 |
os.remove(file)
|
680 |
st.experimental_rerun()
|
|
|
|
|
681 |
if len(file_contents) > 0:
|
682 |
if next_action=='open':
|
683 |
file_content_area = st.text_area("File Contents:", file_contents, height=500)
|
|
|
684 |
if next_action=='md':
|
685 |
st.markdown(file_contents)
|
|
|
686 |
if next_action=='search':
|
687 |
file_content_area = st.text_area("File Contents:", file_contents, height=500)
|
688 |
st.write('Reasoning with your inputs...')
|
689 |
|
690 |
# new - llama
|
691 |
response = StreamLLMChatResponse(file_contents)
|
692 |
-
filename = generate_filename(user_prompt, ".
|
693 |
create_file(filename, response, '', should_save)
|
|
|
|
|
694 |
|
695 |
# old - gpt
|
696 |
#response = chat_with_model(user_prompt, file_contents, model_choice)
|
|
|
659 |
with open(file, 'r') as f:
|
660 |
file_contents = f.read()
|
661 |
next_action='md'
|
|
|
662 |
with col2:
|
663 |
st.markdown(get_table_download_link(file), unsafe_allow_html=True)
|
664 |
with col3:
|
|
|
666 |
with open(file, 'r') as f:
|
667 |
file_contents = f.read()
|
668 |
next_action='open'
|
|
|
669 |
with col4:
|
670 |
if st.button("🔍", key="read_"+file): # search emoji button
|
671 |
with open(file, 'r') as f:
|
672 |
file_contents = f.read()
|
673 |
next_action='search'
|
|
|
674 |
with col5:
|
675 |
if st.button("🗑", key="delete_"+file):
|
676 |
os.remove(file)
|
677 |
st.experimental_rerun()
|
678 |
+
|
679 |
+
|
680 |
if len(file_contents) > 0:
|
681 |
if next_action=='open':
|
682 |
file_content_area = st.text_area("File Contents:", file_contents, height=500)
|
683 |
+
addDocumentHTML5(file_contents)
|
684 |
if next_action=='md':
|
685 |
st.markdown(file_contents)
|
686 |
+
addDocumentHTML5(file_contents)
|
687 |
if next_action=='search':
|
688 |
file_content_area = st.text_area("File Contents:", file_contents, height=500)
|
689 |
st.write('Reasoning with your inputs...')
|
690 |
|
691 |
# new - llama
|
692 |
response = StreamLLMChatResponse(file_contents)
|
693 |
+
filename = generate_filename(user_prompt, ".md")
|
694 |
create_file(filename, response, '', should_save)
|
695 |
+
addDocumentHTML5(file_contents)
|
696 |
+
addDocumentHTML5(response)
|
697 |
|
698 |
# old - gpt
|
699 |
#response = chat_with_model(user_prompt, file_contents, model_choice)
|