Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Introduce timeout on poor models which struggle to project TSNE manifold #272

Open
KristinaUlicna opened this issue Sep 28, 2023 · 0 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@KristinaUlicna
Copy link
Collaborator

Something in the spirit of 👇

import threading

def run_code():
    # Your code to be measured goes here

# Set the threshold time in seconds
threshold_time = 2.0  # Adjust this as needed

# Create a function to run the code with a timeout
def run_code_with_timeout():
    try:
        thread = threading.Thread(target=run_code)
        thread.start()
        thread.join(timeout=threshold_time)

        if thread.is_alive():
            raise TimeoutError(f"Code execution exceeded the threshold time of {threshold_time} seconds")
    except Exception as e:
        raise e

# Call the function to run the code with a timeout
run_code_with_timeout()
@KristinaUlicna KristinaUlicna added bug Something isn't working enhancement New feature or request labels Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants