Boni98 commited on
Commit
186a27e
·
1 Parent(s): aa6f4d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -38,9 +38,6 @@ best_guess = None
38
  def respond(message, chat_history, label_value, image_value):
39
  global has_started, best_guess
40
 
41
- if not has_started:
42
- has_started = True
43
-
44
  logits, is_better = clip_chat.answer(message)
45
  bot_message = logit2sentence(logits, clip_chat.goal)
46
 
@@ -51,12 +48,16 @@ def respond(message, chat_history, label_value, image_value):
51
  best_guess = "YOU WIN! (Press \"Reset\" to play again)"
52
  image_value = clip_chat.image_org
53
  else:
54
- if is_better == -1:
55
- bot_message += ""
56
- elif is_better == 0:
57
- bot_message += "You did worse than the last one."
58
- elif is_better == 1 or is_better == 3:
59
- bot_message += "You did better than the last one."
 
 
 
 
60
 
61
  label_value = best_guess
62
 
 
38
  def respond(message, chat_history, label_value, image_value):
39
  global has_started, best_guess
40
 
 
 
 
41
  logits, is_better = clip_chat.answer(message)
42
  bot_message = logit2sentence(logits, clip_chat.goal)
43
 
 
48
  best_guess = "YOU WIN! (Press \"Reset\" to play again)"
49
  image_value = clip_chat.image_org
50
  else:
51
+ if has_started:
52
+ if is_better == -1:
53
+ bot_message += ""
54
+ elif is_better == 0:
55
+ bot_message += "You did worse than the last one."
56
+ elif is_better == 1 or is_better == 3:
57
+ bot_message += "You did better than the last one."
58
+
59
+ if not has_started:
60
+ has_started = True
61
 
62
  label_value = best_guess
63