Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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['
|
| 43 |
-
html += f"<span class='message'>{row['
|
| 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=["
|
| 54 |
writer.writerow(
|
| 55 |
-
{"
|
| 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)
|