Spaces:
Sleeping
Sleeping
Commit
·
f1eec7d
1
Parent(s):
4260daa
chore: Refactor weighted_random_choice function and improve error message
Browse files
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, "
|
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:
|