harrygens commited on
Commit
f2aae0d
1 Parent(s): 174a913

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -48,10 +48,12 @@ def getChooseRole(msg):
48
 
49
  def getChooseClass(msg):
50
  full = getChooseRole(msg)
51
- if
52
- start_index = full.index(" ") + len(" ")
53
- end_index = msg.index(",")
54
- return trim(full[start_index:] + full[:end_index])
 
 
55
 
56
  def chatbot(input, messages):
57
  messages = messages or [{"role": "system", "content": initMsg}]
 
48
 
49
  def getChooseClass(msg):
50
  full = getChooseRole(msg)
51
+ if full != "":
52
+ start_index = full.index(" ") + len(" ")
53
+ end_index = msg.index(",")
54
+ return trim(full[start_index:] + full[:end_index])
55
+ else:
56
+ return ""
57
 
58
  def chatbot(input, messages):
59
  messages = messages or [{"role": "system", "content": initMsg}]