peterpull commited on
Commit
308df49
·
1 Parent(s): 8810fc0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -39,8 +39,8 @@ def generate_html() -> str:
39
  html = "<div class='chatbot'>"
40
  for row in rows:
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>"
@@ -50,9 +50,9 @@ def generate_html() -> str:
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)
 
39
  html = "<div class='chatbot'>"
40
  for row in rows:
41
  html += "<div>"
42
+ html += f"<span>{row['chatinput']}</span>"
43
+ html += f"<span class='message'>{row['chatresponse']}</span>"
44
  html += f"<span class='time'>{row['time']}</span>"
45
  html += "</div>"
46
  html += "</div>"
 
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=["chatinput", "chatresponse", "time"])
54
  writer.writerow(
55
+ {"chatinput": chatinput, "chatresponse": chatresponse, "time": str(datetime.now())}
56
  )
57
  commit_url = repo.push_to_hub()
58
  print(commit_url)