Unverified Commit f92cc703 authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Ignore all exceptions from signal in dynamic code (#25623)

parent 1982dd3b
...@@ -603,7 +603,7 @@ def resolve_trust_remote_code(trust_remote_code, model_name, has_local_code, has ...@@ -603,7 +603,7 @@ def resolve_trust_remote_code(trust_remote_code, model_name, has_local_code, has
elif answer.lower() in ["no", "n", "0", ""]: elif answer.lower() in ["no", "n", "0", ""]:
trust_remote_code = False trust_remote_code = False
signal.alarm(0) signal.alarm(0)
except AttributeError: except Exception:
# OS which does not support signal.SIGALRM # OS which does not support signal.SIGALRM
raise ValueError( raise ValueError(
"Loading this model requires you to execute execute some code in that repo on your local machine. " "Loading this model requires you to execute execute some code in that repo on your local machine. "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment