awacke1 commited on
Commit
92736b0
1 Parent(s): 001a7fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -283,7 +283,10 @@ def create_file(filename, prompt, response, should_save=True):
283
  base_filename, ext = os.path.splitext(filename)
284
  if ext in ['.txt', '.htm', '.md']:
285
  with open(f"{base_filename}.md", 'w') as file:
286
- content = prompt.strip() + '\r\n' + response
 
 
 
287
  file.write(content)
288
 
289
  #has_python_code = re.search(r"```python([\s\S]*?)```", prompt.strip() + '\r\n' + response)
 
283
  base_filename, ext = os.path.splitext(filename)
284
  if ext in ['.txt', '.htm', '.md']:
285
  with open(f"{base_filename}.md", 'w') as file:
286
+ try:
287
+ content = prompt.strip() + '\r\n' + response
288
+ except:
289
+ st.write('.')
290
  file.write(content)
291
 
292
  #has_python_code = re.search(r"```python([\s\S]*?)```", prompt.strip() + '\r\n' + response)