ml-explore / mlx-examples

Examples in the MLX framework
MIT License
6.29k stars 897 forks source link

add timeout for generate #1070

Closed jincdream closed 1 month ago

jincdream commented 1 month ago

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:

awni commented 1 month ago

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.