Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -54,25 +54,25 @@ def generate_html() -> str:
|
|
54 |
rows.append(row)
|
55 |
rows.reverse()
|
56 |
if len(rows) == 0:
|
57 |
-
return "
|
58 |
else:
|
59 |
html = "<div class='chatbot'>"
|
60 |
for row in rows:
|
61 |
html += "<div>"
|
62 |
html += f"<span>{row['name']}</span>"
|
63 |
-
html += f"<span>{row['
|
64 |
-
html += f"<span class='
|
65 |
html += "</div>"
|
66 |
html += "</div>"
|
67 |
return html
|
68 |
|
69 |
|
70 |
-
def store_message(name: str,
|
71 |
if name and message:
|
72 |
with open(DATA_FILE, "a") as csvfile:
|
73 |
-
writer = csv.DictWriter(csvfile, fieldnames=["name", "rate", "
|
74 |
writer.writerow(
|
75 |
-
{"name": name, "rate": rate, "
|
76 |
)
|
77 |
commit_url = upload_file(
|
78 |
DATA_FILE,
|
@@ -91,7 +91,7 @@ iface = gr.Interface(
|
|
91 |
[
|
92 |
inputs.Textbox(placeholder="Your name"),
|
93 |
inputs.Textbox(placeholder="Rate"),
|
94 |
-
inputs.Textbox(placeholder="
|
95 |
],
|
96 |
"html",
|
97 |
css="""
|
|
|
54 |
rows.append(row)
|
55 |
rows.reverse()
|
56 |
if len(rows) == 0:
|
57 |
+
return "nothing yet"
|
58 |
else:
|
59 |
html = "<div class='chatbot'>"
|
60 |
for row in rows:
|
61 |
html += "<div>"
|
62 |
html += f"<span>{row['name']}</span>"
|
63 |
+
html += f"<span>{row['name']}</span>"
|
64 |
+
html += f"<span class='celsci'>{row['celsci']}</span>"
|
65 |
html += "</div>"
|
66 |
html += "</div>"
|
67 |
return html
|
68 |
|
69 |
|
70 |
+
def store_message(name: str, rate: str, celsci: str):
|
71 |
if name and message:
|
72 |
with open(DATA_FILE, "a") as csvfile:
|
73 |
+
writer = csv.DictWriter(csvfile, fieldnames=["name", "rate", "celsci"])
|
74 |
writer.writerow(
|
75 |
+
{"name": name, "rate": rate, "celsci": celsci)}
|
76 |
)
|
77 |
commit_url = upload_file(
|
78 |
DATA_FILE,
|
|
|
91 |
[
|
92 |
inputs.Textbox(placeholder="Your name"),
|
93 |
inputs.Textbox(placeholder="Rate"),
|
94 |
+
inputs.Textbox(placeholder="Celsci"), #, lines=2),
|
95 |
],
|
96 |
"html",
|
97 |
css="""
|