merve HF staff commited on
Commit
5d4dfc8
β€’
1 Parent(s): 51739ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -30,13 +30,6 @@ message_history.append({"text":input, "is_user" : True})
30
 
31
  placeholder = st.empty() # placeholder for latest message
32
 
33
- with placeholder.container():
34
- last_message = message_history[-1]
35
- if last_message != "":
36
-
37
- message(last_message["text"], last_message["is_user"]) # display the latest message
38
-
39
-
40
  data, resp = query(
41
  {
42
  "inputs": {
@@ -51,6 +44,10 @@ if resp.status_code == 200:
51
  response_templates = [f"{model_answer} is the best task for this 🀩", f"I think you should use {model_answer} πŸͺ„", f"I think {model_answer} should work for you πŸ€“"]
52
 
53
  bot_answer = random.choice(response_templates)
54
-
55
  message_history.append({"text":bot_answer, "is_user" : False})
56
 
 
 
 
 
 
 
30
 
31
  placeholder = st.empty() # placeholder for latest message
32
 
 
 
 
 
 
 
 
33
  data, resp = query(
34
  {
35
  "inputs": {
 
44
  response_templates = [f"{model_answer} is the best task for this 🀩", f"I think you should use {model_answer} πŸͺ„", f"I think {model_answer} should work for you πŸ€“"]
45
 
46
  bot_answer = random.choice(response_templates)
 
47
  message_history.append({"text":bot_answer, "is_user" : False})
48
 
49
+ with placeholder.container():
50
+ last_message = message_history[-1]
51
+ if last_message != "":
52
+ message(last_message["text"], last_message["is_user"]) # display the latest message
53
+