You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
raiseValueError(f"If auto is None, num_trials must also be provided. Given num_candidates={self.num_candidates}, we'd recommend setting num_trials to ~{self._set_num_trials_from_num_candidates(student, zeroshot_opt, self.num_candidates)}.")
123
+
124
+
# If auto is None, and num_candidates or num_trials is None, raise an error
raiseValueError("If auto is not None, num_candidates and num_trials cannot be set, since they would be overrided by the auto settings. Please either set auto to None, or do not specify num_candidates and num_trials.")
To proceed with the execution of this program, please confirm by typing {BLUE}'y'{ENDC} for yes or {BLUE}'n'{ENDC} for no.
375
+
If no input is received within 20 seconds, the program will proceed automatically.
356
376
357
377
If you would like to bypass this confirmation step in future executions, set the {YELLOW}`requires_permission_to_run`{ENDC} flag to {YELLOW}`False`{ENDC} when calling compile.
358
378
359
379
{YELLOW}Awaiting your input...{ENDC}
360
380
"""
361
381
)
362
382
363
-
user_input= (
364
-
input(f"{user_message}\n{user_confirmation_message}\nDo you wish to continue? (y/n): ").strip().lower()
365
-
)
366
-
returnuser_input=="y"
383
+
print(f"{user_message}\n{user_confirmation_message}\nDo you wish to continue? (y/n): ", end='', flush=True)
384
+
385
+
# Wait for input with timeout
386
+
start_time=time.time()
387
+
whiletime.time() -start_time<20:
388
+
ifselect.select([sys.stdin], [], [], 0.1)[0]:
389
+
user_input=sys.stdin.readline().strip().lower()
390
+
returnuser_input=="y"
391
+
time.sleep(0.1)
392
+
393
+
print("\nNo input received within 20 seconds. Proceeding with execution...")
0 commit comments