We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
def _setup_redis_worker_and_runforever(model_class, batch_size, max_latency, gpu_id, redis_broker, prefix=''): redis_worker = RedisWorker(model_class, batch_size, max_latency, redis_broker=redis_broker, prefix=prefix) redis_worker.run_forever(gpu_id)
def run_redis_workers_forever(model_class, batch_size, max_latency=0.1, worker_num=1, cuda_devices=None, redis_broker="localhost:6379", prefix='', model_init_args=None, model_init_kwargs=None): procs = [] for i in range(worker_num): if cuda_devices is not None: gpu_id = cuda_devices[i % len(cuda_devices)] else: gpu_id = None args = [model_class, batch_size, max_latency, gpu_id, redis_broker, prefix] p = mp.Process(target=_setup_redis_worker_and_runforever, args=args, name="stream_worker", daemon=True) p.start() procs.append(p)
for p in procs: p.join()
model_init_args & model_init_kwargs 这俩参数没往里面传, init_model这个方法读不到参数,得改一下才行。。。所以作者你觉得这是问题还不是个问题?我比较菜,就不乱改了。
The text was updated successfully, but these errors were encountered:
怪了,我是从pip 下载的。。。为什么会不一样呢。。。
Sorry, something went wrong.
我重新确定了下,github上的代码是可以直接传参数的,我也是这么改的。但是pip安装的确实跟github是不一样的。求作者重新上传下
No branches or pull requests
def _setup_redis_worker_and_runforever(model_class, batch_size, max_latency, gpu_id, redis_broker, prefix=''):
redis_worker = RedisWorker(model_class, batch_size, max_latency, redis_broker=redis_broker, prefix=prefix)
redis_worker.run_forever(gpu_id)
def run_redis_workers_forever(model_class, batch_size, max_latency=0.1,
worker_num=1, cuda_devices=None, redis_broker="localhost:6379",
prefix='', model_init_args=None, model_init_kwargs=None):
procs = []
for i in range(worker_num):
if cuda_devices is not None:
gpu_id = cuda_devices[i % len(cuda_devices)]
else:
gpu_id = None
args = [model_class, batch_size, max_latency, gpu_id, redis_broker, prefix]
p = mp.Process(target=_setup_redis_worker_and_runforever, args=args, name="stream_worker", daemon=True)
p.start()
procs.append(p)
model_init_args & model_init_kwargs 这俩参数没往里面传, init_model这个方法读不到参数,得改一下才行。。。所以作者你觉得这是问题还不是个问题?我比较菜,就不乱改了。
The text was updated successfully, but these errors were encountered: