Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -66,13 +66,15 @@ def save_and_play_audio(audio_recorder):
|
|
66 |
def create_file(filename, prompt, response):
|
67 |
if filename.endswith(".txt"):
|
68 |
with open(filename, 'w') as file:
|
69 |
-
|
|
|
70 |
elif filename.endswith(".htm"):
|
71 |
with open(filename, 'w') as file:
|
72 |
-
file.write(f"
|
73 |
elif filename.endswith(".md"):
|
74 |
with open(filename, 'w') as file:
|
75 |
-
file.write(f"
|
|
|
76 |
def truncate_document(document, length):
|
77 |
return document[:length]
|
78 |
def divide_document(document, max_length):
|
|
|
66 |
def create_file(filename, prompt, response):
|
67 |
if filename.endswith(".txt"):
|
68 |
with open(filename, 'w') as file:
|
69 |
+
#file.write(f"{prompt}\nResponse:\n{response}")
|
70 |
+
file.write(f"{prompt}\r\n{response}")
|
71 |
elif filename.endswith(".htm"):
|
72 |
with open(filename, 'w') as file:
|
73 |
+
file.write(f"{prompt} {response}")
|
74 |
elif filename.endswith(".md"):
|
75 |
with open(filename, 'w') as file:
|
76 |
+
file.write(f"{prompt}\n\n{response}")
|
77 |
+
|
78 |
def truncate_document(document, length):
|
79 |
return document[:length]
|
80 |
def divide_document(document, max_length):
|