Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -109,7 +109,10 @@ with gr.Blocks(
|
|
| 109 |
die2 = random.randint(1, 6)
|
| 110 |
roll = die1 + die2
|
| 111 |
|
| 112 |
-
|
|
|
|
|
|
|
|
|
|
| 113 |
won = result["game_state"] == "success"
|
| 114 |
|
| 115 |
delta = 10 if won else -5
|
|
|
|
| 109 |
die2 = random.randint(1, 6)
|
| 110 |
roll = die1 + die2
|
| 111 |
|
| 112 |
+
from concurrent.futures import ThreadPoolExecutor
|
| 113 |
+
with ThreadPoolExecutor(max_workers=1) as executor:
|
| 114 |
+
future = executor.submit(graph.invoke, {"bet": bet, "roll": roll, "game_state": "pending"})
|
| 115 |
+
result = future.result()
|
| 116 |
won = result["game_state"] == "success"
|
| 117 |
|
| 118 |
delta = 10 if won else -5
|