jadend commited on
Commit
516da88
·
1 Parent(s): 3b1fdc3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -18
app.py CHANGED
@@ -17,23 +17,23 @@ repo = Repository(
17
  local_dir="data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN
18
  )
19
 
20
- def generate_html() -> str:
21
- with open(DATA_FILE) as csvfile:
22
- reader = csv.DictReader(csvfile)
23
- rows = []
24
- for row in reader:
25
- rows.append(row)
26
- rows.reverse()
27
- if len(rows) == 0:
28
- return "no premises yet"
29
- else:
30
- html = "<div class='chatbot'>"
31
- for row in rows:
32
- html += "<div>"
33
- html += f"<span class='message'>{row['message']}</span>"
34
- html += "</div>"
35
- html += "</div>"
36
- return html
37
 
38
  def store_message(premise: str):
39
  if premise:
@@ -45,7 +45,7 @@ def store_message(premise: str):
45
  commit_url = repo.push_to_hub()
46
  print(commit_url)
47
 
48
- return generate_html()
49
 
50
 
51
  user_db = {os.environ["admin_username"]: os.environ["admin_password"],
 
17
  local_dir="data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN
18
  )
19
 
20
+ #def generate_html() -> str:
21
+ # with open(DATA_FILE) as csvfile:
22
+ # reader = csv.DictReader(csvfile)
23
+ # rows = []
24
+ # for row in reader:
25
+ # rows.append(row)
26
+ # rows.reverse()
27
+ # if len(rows) == 0:
28
+ # return "no premises yet"
29
+ # else:
30
+ # html = "<div class='chatbot'>"
31
+ # for row in rows:
32
+ # html += "<div>"
33
+ # html += f"<span class='message'>{row['message']}</span>"
34
+ # html += "</div>"
35
+ # html += "</div>"
36
+ # return html
37
 
38
  def store_message(premise: str):
39
  if premise:
 
45
  commit_url = repo.push_to_hub()
46
  print(commit_url)
47
 
48
+ return # generate_html()
49
 
50
 
51
  user_db = {os.environ["admin_username"]: os.environ["admin_password"],