Update.
authorFrançois Fleuret <francois@fleuret.org>
Wed, 17 Jul 2024 20:31:56 +0000 (22:31 +0200)
committerFrançois Fleuret <francois@fleuret.org>
Wed, 17 Jul 2024 20:31:56 +0000 (22:31 +0200)
main.py

diff --git a/main.py b/main.py
index 178925b..bdfe9fd 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -467,11 +467,14 @@ def record_new_c_quizzes(models, quiz_machine, nb_for_train=1000, nb_for_test=10
 
         duration = time.perf_counter() - start_time
 
-        if total_nb_validated > 0 and total_nb_validated < nb_to_create:
-            d = (nb_to_create - total_nb_validated) * duration / total_nb_validated
-            e = (datetime.datetime.now() + datetime.timedelta(seconds=d)).strftime(
-                "%a %H:%M"
-            )
+        if total_nb_validated > 0:
+            if total_nb_validated < nb_to_create:
+                d = (nb_to_create - total_nb_validated) * duration / total_nb_validated
+                e = (datetime.datetime.now() + datetime.timedelta(seconds=d)).strftime(
+                    "%a %H:%M"
+                )
+            else:
+                e = "now!"
         else:
             e = "???"