jina-ai / dev-gpt

Your Virtual Development Team

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No Windows Compatibility for timeout_decorator.py

MR-Alex42 opened this issue · comments

I'm running gptdeploy on Windows 10. You are using attributes and methods of timeout_decorator.py only available on Unix.

Example:
Traceback (most recent call last):
File "G:\Programme\gptdeploy\gptdeploy.py", line 5, in
main()
File "G:\Programme\Python\Python310\lib\site-packages\click\core.py", line 1130, in call
return self.main(*args, **kwargs)
File "G:\Programme\Python\Python310\lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
File "G:\Programme\Python\Python310\lib\site-packages\click\core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "G:\Programme\Python\Python310\lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "G:\Programme\Python\Python310\lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "G:\Programme\gptdeploy\src\cli.py", line 38, in wrapper
return func(*args, **kwargs)
File "G:\Programme\gptdeploy\src\cli.py", line 74, in generate
generator.generate(path)
File "G:\Programme\gptdeploy\src\options\generate\generator.py", line 290, in generate
final_version_path = self.debug_microservice(
File "G:\Programme\gptdeploy\src\options\generate\generator.py", line 200, in debug_microservice
log_hubble = push_executor(previous_microservice_path)
File "G:\Programme\gptdeploy\src\apis\jina_cloud.py", line 68, in push_executor
return _push_executor(dir_path)
File "G:\Programme\Python\Python310\lib\site-packages\timeout_decorator\timeout_decorator.py", line 75, in new_function
old = signal.signal(signal.SIGALRM, handler)
AttributeError: module 'signal' has no attribute 'SIGALRM'. Did you mean: 'SIGABRT'?

Examples:
signal.SIGALRM
Timer signal from alarm(2).
Availability: Unix.

signal.setitimer(which, seconds, interval=0.0)
Sets given interval timer (one of signal.ITIMER_REAL, signal.ITIMER_VIRTUAL or signal.ITIMER_PROF) specified by which to fire after seconds (float is accepted, different from alarm()) and after that every interval seconds (if interval is non-zero). The interval timer specified by which can be cleared by setting seconds to zero.

When an interval timer fires, a signal is sent to the process. The signal sent is dependent on the timer being used; signal.ITIMER_REAL will deliver SIGALRM, signal.ITIMER_VIRTUAL sends SIGVTALRM, and signal.ITIMER_PROF will deliver SIGPROF.

The old values are returned as a tuple: (delay, interval).

Attempting to pass an invalid interval timer will cause an ItimerError.

Availability: Unix.

Thanks for reporting. I will have a look asap

I updated the version. Thank you so much for mentioning this. It should work now
pip install gptdeploy -U

Works. Thank you. This is an amazing project.