merve HF Staff commited on
Commit
8ae824c
Β·
1 Parent(s): 2fc5351

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -37,13 +37,15 @@ link_dict = {
37
  message_history = [{"text":"Let's find out the best task for your use case! Tell me about your use case :)", "is_user":False}]
38
 
39
  input = st.text_input("Ask me πŸ€—")
 
 
40
  for msg in message_history:
41
  message(msg["text"], is_user = msg["is_user"]) # display all the previous message
42
 
43
- message_history.append({"text":input, "is_user" : True})
44
 
45
 
46
- placeholder = st.empty() # placeholder for latest message
 
47
 
48
  data, resp = query(
49
  {
@@ -63,7 +65,6 @@ if resp.status_code == 200:
63
  url = link_dict[key]
64
  response_templates = [f"I think that {model_answer} is the best task for this 🀩 Check out the page πŸ‘‰πŸΌ {url}", f"I think you should use {model_answer} πŸͺ„ Check it out here πŸ‘‰πŸΌ {url}", f"I think {model_answer} should work for you πŸ€“ Check out the page πŸ‘‰πŸΌ {url}"]
65
 
66
-
67
  bot_answer = random.choice(response_templates)
68
  message_history.append({"text":bot_answer, "is_user" : False})
69
  else:
 
37
  message_history = [{"text":"Let's find out the best task for your use case! Tell me about your use case :)", "is_user":False}]
38
 
39
  input = st.text_input("Ask me πŸ€—")
40
+ message_history.append({"text":input, "is_user" : True})
41
+
42
  for msg in message_history:
43
  message(msg["text"], is_user = msg["is_user"]) # display all the previous message
44
 
 
45
 
46
 
47
+
48
+ #placeholder = st.empty() # placeholder for latest message
49
 
50
  data, resp = query(
51
  {
 
65
  url = link_dict[key]
66
  response_templates = [f"I think that {model_answer} is the best task for this 🀩 Check out the page πŸ‘‰πŸΌ {url}", f"I think you should use {model_answer} πŸͺ„ Check it out here πŸ‘‰πŸΌ {url}", f"I think {model_answer} should work for you πŸ€“ Check out the page πŸ‘‰πŸΌ {url}"]
67
 
 
68
  bot_answer = random.choice(response_templates)
69
  message_history.append({"text":bot_answer, "is_user" : False})
70
  else: