peterpull commited on
Commit
8810fc0
·
1 Parent(s): 7a0a525

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -41,16 +41,18 @@ def generate_html() -> str:
41
  html += "<div>"
42
  html += f"<span>{row['User input']}</span>"
43
  html += f"<span class='message'>{row['Chatbot Response']}</span>"
 
44
  html += "</div>"
45
  html += "</div>"
46
  return html
47
 
 
48
  def store_message(chatinput: str, chatresponse: str):
49
  if chatinput and chatresponse:
50
  with open(DATA_FILE, "a") as csvfile:
51
- writer = csv.DictWriter(csvfile, fieldnames=["User", "Chatbot", "time"])
52
  writer.writerow(
53
- {"User": chatinput, "Chatbot": chatresponse, "time": str(datetime.now())}
54
  )
55
  commit_url = repo.push_to_hub()
56
  print(commit_url)
 
41
  html += "<div>"
42
  html += f"<span>{row['User input']}</span>"
43
  html += f"<span class='message'>{row['Chatbot Response']}</span>"
44
+ html += f"<span class='time'>{row['time']}</span>"
45
  html += "</div>"
46
  html += "</div>"
47
  return html
48
 
49
+
50
  def store_message(chatinput: str, chatresponse: str):
51
  if chatinput and chatresponse:
52
  with open(DATA_FILE, "a") as csvfile:
53
+ writer = csv.DictWriter(csvfile, fieldnames=["User input", "Chatbot Response", "time"])
54
  writer.writerow(
55
+ {"User input": chatinput, "Chatbot Response": chatresponse, "time": str(datetime.now())}
56
  )
57
  commit_url = repo.push_to_hub()
58
  print(commit_url)