This pull request introduces a timeout mechanism to various generation functions across multiple files. The main changes include importing the signal module, adding a timeout parameter, and handling timeout exceptions.
Timeout mechanism implementation:
cvae/main.py: Added a timeout parameter to the generate function and implemented signal handling to raise a TimeoutError if the generation process exceeds the specified timeout. [1][2][3]
flux/dreambooth.py: Updated the generate_progress_images function to include a timeout parameter and signal handling for timeout exceptions. [1][2][3]
llava/generate.py: Added a timeout argument to the argument parser and included signal handling in the main function to manage generation timeouts. [1][2][3][4]
llms/mlx_lm/generate.py: Added a timeout argument to the argument parser and implemented signal handling in the main function to raise a TimeoutError on timeout. [1][2][3][4]
musicgen/generate.py: Added a timeout parameter to the main function and implemented signal handling for timeouts. [1][2]
stable_diffusion/txt2image.py: Introduced a timeout argument to the argument parser and included signal handling in the main generation process to handle timeouts. [1][2][3][4]
Thanks for the PR. I don't see a need for a timeout inside these examples so I will close this. Feel free to file an issue or start a discussion if you are unsure about a feature addition moving forward.
This pull request introduces a timeout mechanism to various generation functions across multiple files. The main changes include importing the
signal
module, adding a timeout parameter, and handling timeout exceptions.Timeout mechanism implementation:
cvae/main.py
: Added a timeout parameter to thegenerate
function and implemented signal handling to raise aTimeoutError
if the generation process exceeds the specified timeout. [1] [2] [3]flux/dreambooth.py
: Updated thegenerate_progress_images
function to include a timeout parameter and signal handling for timeout exceptions. [1] [2] [3]llava/generate.py
: Added a timeout argument to the argument parser and included signal handling in themain
function to manage generation timeouts. [1] [2] [3] [4]llms/gguf_llm/generate.py
: Introduced a timeout parameter to thegenerate
function and implemented signal handling for timeouts. [1] [2] [3] [4]llms/mlx_lm/generate.py
: Added a timeout argument to the argument parser and implemented signal handling in themain
function to raise aTimeoutError
on timeout. [1] [2] [3] [4]llms/speculative_decoding/main.py
: Included a timeout parameter and signal handling in themain
function to manage generation timeouts. [1] [2] [3] [4]musicgen/generate.py
: Added a timeout parameter to themain
function and implemented signal handling for timeouts. [1] [2]stable_diffusion/txt2image.py
: Introduced a timeout argument to the argument parser and included signal handling in the main generation process to handle timeouts. [1] [2] [3] [4]