awacke1 commited on
Commit
387d633
β€’
1 Parent(s): ba84adc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -24,9 +24,9 @@ def chat_with_model(prompts):
24
  return response['choices'][0]['message']['content']
25
 
26
  def generate_filename(prompt):
27
- safe_date_time = datetime.now().strftime("%m_%d_%H_%M")
28
- safe_prompt = "".join(x for x in prompt if x.isalnum())[:50]
29
- return f"{safe_date_time}_{safe_prompt}.htm"
30
 
31
  def create_file(filename, prompt, response):
32
  with open(filename, 'w') as file:
@@ -93,7 +93,7 @@ def main():
93
 
94
  st.sidebar.markdown(get_table_download_link(filename), unsafe_allow_html=True)
95
 
96
- htm_files = glob.glob("*.htm")
97
  for file in htm_files:
98
  st.sidebar.markdown(get_table_download_link(file), unsafe_allow_html=True)
99
 
 
24
  return response['choices'][0]['message']['content']
25
 
26
  def generate_filename(prompt):
27
+ safe_date_time = datetime.now().strftime("%m%d_%H%M")
28
+ safe_prompt = "".join(x for x in prompt if x.isalnum())[:30]
29
+ return f"{safe_date_time}_{safe_prompt}.txt"
30
 
31
  def create_file(filename, prompt, response):
32
  with open(filename, 'w') as file:
 
93
 
94
  st.sidebar.markdown(get_table_download_link(filename), unsafe_allow_html=True)
95
 
96
+ htm_files = glob.glob("*.txt")
97
  for file in htm_files:
98
  st.sidebar.markdown(get_table_download_link(file), unsafe_allow_html=True)
99