如何 在运行python startup.py -a 时候 通过命令行指定--device参数来设定运行模型的设备为cpu #2880
Replies: 1 comment 2 replies
-
🤖 嘿,@Liwan-Chen!很高兴再次见到你,在这里遇见熟悉的朋友总是令人兴奋的 🚀 根据您的需求,您可以在运行 "python startup.py -a" 时,通过在命令行中添加 "--device" 参数来指定运行模型的设备为 CPU。具体的命令如下: python startup.py -a --device cpu 在上述代码中,"--device" 参数的值被设置为 "cpu",这意味着模型将在 CPU 上运行。 此外,根据我在 Langchain-Chatchat 仓库中的 以下是相关的代码片段: worker = ModelWorker(
controller_addr=args.controller_address,
worker_addr=args.worker_address,
worker_id=worker_id,
model_path=args.model_path,
model_names=args.model_names,
limit_worker_concurrency=args.limit_worker_concurrency,
no_register=args.no_register,
device=args.device, # 这里就是使用 --device 参数的地方
num_gpus=args.num_gpus,
max_gpu_memory=args.max_gpu_memory,
load_8bit=args.load_8bit,
cpu_offloading=args.cpu_offloading,
gptq_config=gptq_config,
awq_config=awq_config,
stream_interval=args.stream_interval,
conv_template=args.conv_template,
embed_in_truncate=args.embed_in_truncate,
) 因此,您可以放心地使用上述命令来指定运行模型的设备为 CPU。 SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
如何 在运行python startup.py -a 时候 通过命令行指定--device参数来设定运行模型的设备 为cpu
Beta Was this translation helpful? Give feedback.
All reactions