awacke1 commited on
Commit
eeba7ab
·
1 Parent(s): 6426b3c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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
- file.write(f"Prompt:\n{prompt}\nResponse:\n{response}")
 
70
  elif filename.endswith(".htm"):
71
  with open(filename, 'w') as file:
72
- file.write(f"<h1>Prompt:</h1> <p>{prompt}</p> <h1>Response:</h1> <p>{response}</p>")
73
  elif filename.endswith(".md"):
74
  with open(filename, 'w') as file:
75
- file.write(f"# Prompt:\n{prompt}\n# Response:\n{response}")
 
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):