TejAndrewsACC commited on
Commit
6dd51aa
·
verified ·
1 Parent(s): 426aa25

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -3895,11 +3895,12 @@ def respond(message, history, max_tokens, temperature, top_p):
3895
  ):
3896
  token = message.choices[0].delta.content
3897
  response += token
3898
- if "I cannot" in response or "I can't" in response or "I won't" in response or "I'm not going to engage in this conversation" in response:
3899
- response = random.choice(alternative_responses)
3900
-
3901
- yield response
3902
 
 
 
 
 
3903
 
3904
  css = """
3905
  /* Import Caveat font from Google Fonts */
 
3895
  ):
3896
  token = message.choices[0].delta.content
3897
  response += token
3898
+ yield response
 
 
 
3899
 
3900
+ if any(phrase in response for phrase in ["I cannot", "I can't", "I won't", "I'm not going to engage in this conversation"]):
3901
+ response = random.choice(alternative_responses)
3902
+
3903
+ yield response
3904
 
3905
  css = """
3906
  /* Import Caveat font from Google Fonts */