Skip to content

Commit 2fcee78

Browse files
committed
Allow running a model without any device
Useful for testing the CPU performance
1 parent 3152564 commit 2fcee78

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ramalama/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ def runtime_options(parser, command):
775775
"-d", "--detach", action="store_true", dest="detach", help="run the container in detached mode"
776776
)
777777
parser.add_argument(
778-
"--device", dest="device", action='append', type=str, help="device to leak in to the running container"
778+
"--device", dest="device", action='append', type=str, help="device to leak in to the running container (or 'none' to pass no device)"
779779
)
780780
parser.add_argument(
781781
"--env",

ramalama/engine.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ def add_port_option(self):
118118
self.exec_args += ["-p", f"{host}{self.args.port}:{self.args.port}"]
119119

120120
def add_device_options(self):
121+
request_no_device = getattr(self.args, "device", None) == ['none']
122+
if request_no_device:
123+
return
124+
121125
if getattr(self.args, "device", None):
122126
for device_arg in self.args.device:
123127
self.exec_args += ["--device", device_arg]

0 commit comments

Comments
 (0)