winglian commited on
Commit
56e046b
1 Parent(s): ecbf45e

debugging for missing state

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -185,6 +185,7 @@ def chat(history1, history2, system_msg):
185
  model1_res = model1(messages1) # type: Generator[str, None, None]
186
  model2_res = model2(messages2) # type: Generator[str, None, None]
187
  res = token_generator(model1_res, model2_res, lambda x: x[0]['generated_text'], fillvalue=[{'generated_text': ''}]) # type: Generator[Tuple[str, str], None, None]
 
188
  for t1, t2 in res:
189
  if t1 is not None:
190
  history1[-1][1] += t1
@@ -196,6 +197,8 @@ def chat(history1, history2, system_msg):
196
 
197
 
198
  def chosen_one(label, choice1_history, choice2_history, system_msg, nudge_msg, rlhf_persona, state):
 
 
199
  # Generate a uuid for each submission
200
  arena_battle_id = str(uuid.uuid4())
201
 
 
185
  model1_res = model1(messages1) # type: Generator[str, None, None]
186
  model2_res = model2(messages2) # type: Generator[str, None, None]
187
  res = token_generator(model1_res, model2_res, lambda x: x[0]['generated_text'], fillvalue=[{'generated_text': ''}]) # type: Generator[Tuple[str, str], None, None]
188
+ logging.info({"models": [model1.name, model2.name]})
189
  for t1, t2 in res:
190
  if t1 is not None:
191
  history1[-1][1] += t1
 
197
 
198
 
199
  def chosen_one(label, choice1_history, choice2_history, system_msg, nudge_msg, rlhf_persona, state):
200
+ if not state:
201
+ logging.error("missing state!!!")
202
  # Generate a uuid for each submission
203
  arena_battle_id = str(uuid.uuid4())
204