Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
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)
|