PhilSpiel commited on
Commit
009c300
·
1 Parent(s): 484e1a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -13
app.py CHANGED
@@ -26,19 +26,16 @@ def generate_speech(name, raw_input_text):
26
  user_hist_file = "jcTSS-" + user_id + ".txt"
27
 
28
  # Check if user history file exists
29
- if os.path.exists(user_hist_file):
30
- with open(user_hist_file, "r", encoding="UTF-8") as file:
31
- user_hist = file.read().strip()
32
- else:
33
- if os.path.exists(user_hist_file):
34
- with open(user_hist_file, "r", encoding="UTF-8") as file:
35
- user_hist = file.read().strip()
36
- else:
37
- with open(user_hist_file, "w", encoding="UTF-8") as file:
38
- file.write("User ID: " + user_id)
39
-
40
- input_text1 = f"I'm {name}. " + input_text
41
- history_openai_format.append({"role": "user", "content": input_text1})
42
 
43
  # Rest of function
44
 
 
26
  user_hist_file = "jcTSS-" + user_id + ".txt"
27
 
28
  # Check if user history file exists
29
+ if os.path.exists(user_hist_file):
30
+ with open(user_hist_file, "r", encoding="UTF-8") as file:
31
+ user_hist = file.read().strip()
32
+ else:
33
+ with open(user_hist_file, "w", encoding="UTF-8") as file:
34
+ file.write("User ID: " + user_id)
35
+
36
+ # Next lines no longer indented too far left
37
+ input_text1 = f"I'm {name}. " + input_text
38
+ history_openai_format.append({"role": "user", "content": input_text1})
 
 
 
39
 
40
  # Rest of function
41