davanstrien HF Staff commited on
Commit
f1eec7d
·
1 Parent(s): 4260daa

chore: Refactor weighted_random_choice function and improve error message

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -104,7 +104,7 @@ def weighted_random_choice(choices: List[Tuple[Callable, float]]) -> Callable:
104
  if upto + weight >= r:
105
  return choice
106
  upto += weight
107
- assert False, "Shouldn't get here"
108
 
109
 
110
  def generate_prompt() -> str:
 
104
  if upto + weight >= r:
105
  return choice
106
  upto += weight
107
+ assert False, "Invalid weights"
108
 
109
 
110
  def generate_prompt() -> str: