peterpull commited on
Commit
0754fb2
·
1 Parent(s): 05cc001

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -40,14 +40,11 @@ def generate_text() -> str:
40
  def store_message(chatinput: str, chatresponse: str):
41
  if chatinput and chatresponse:
42
  with open(DATA_FILE, "a") as file:
43
- now = datetime.now(tz=AEST)
44
  timestamp = now.strftime("%Y-%m-%d %H:%M:%S")
45
  file.write(f"{timestamp},{chatinput},{chatresponse}\n")
46
  print(f"Stored message: {timestamp},{chatinput},{chatresponse}")
47
- try:
48
- repo.upload(DATA_FILENAME, commit_message="Update data.txt")
49
- except Exception as e:
50
- print(f"Error uploading to repository: {str(e)}")
51
  return generate_text()
52
 
53
 
 
40
  def store_message(chatinput: str, chatresponse: str):
41
  if chatinput and chatresponse:
42
  with open(DATA_FILE, "a") as file:
43
+ now = datetime.now()
44
  timestamp = now.strftime("%Y-%m-%d %H:%M:%S")
45
  file.write(f"{timestamp},{chatinput},{chatresponse}\n")
46
  print(f"Stored message: {timestamp},{chatinput},{chatresponse}")
47
+
 
 
 
48
  return generate_text()
49
 
50