awacke1 commited on
Commit
55c04e3
β€’
1 Parent(s): a4f0d66

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -102,20 +102,20 @@ def main():
102
 
103
  if uploaded_file is not None:
104
  file_content = read_file_content(uploaded_file)
105
- st.markdown(f"**Content Added to Prompt:**\n{file_content}")
106
  prompts.append(file_content)
107
 
108
- if st.button('Chat'):
109
  st.write('Chatting with GPT-3...')
110
  response = chat_with_model(prompts)
111
  st.write('Response:')
112
  st.write(response)
113
-
114
  filename = generate_filename(user_prompt)
115
  create_file(filename, user_prompt, response)
116
-
117
  st.sidebar.markdown(get_table_download_link(filename), unsafe_allow_html=True)
118
-
 
 
 
119
  htm_files = glob.glob("*.txt")
120
  for file in htm_files:
121
  st.sidebar.markdown(get_table_download_link(file), unsafe_allow_html=True)
 
102
 
103
  if uploaded_file is not None:
104
  file_content = read_file_content(uploaded_file)
 
105
  prompts.append(file_content)
106
 
107
+ if st.button('πŸ’¬ Chat'):
108
  st.write('Chatting with GPT-3...')
109
  response = chat_with_model(prompts)
110
  st.write('Response:')
111
  st.write(response)
 
112
  filename = generate_filename(user_prompt)
113
  create_file(filename, user_prompt, response)
 
114
  st.sidebar.markdown(get_table_download_link(filename), unsafe_allow_html=True)
115
+
116
+ if file_content is not None:
117
+ st.markdown(f"**Content Added to Prompt:**\n{file_content}")
118
+
119
  htm_files = glob.glob("*.txt")
120
  for file in htm_files:
121
  st.sidebar.markdown(get_table_download_link(file), unsafe_allow_html=True)