Skip to content

Commit

Permalink
This PR adds the missing bash to the magic run bash run.sh which
Browse files Browse the repository at this point in the history
without it seems to cause errors for some users. Also makes `console.py`
to use magic.

MODULAR_ORIG_COMMIT_REV_ID: ebadc222826cef6bd4dd1664709a9f9f7dfe212c
  • Loading branch information
ehsanmok authored and modularbot committed Dec 17, 2024
1 parent bf214df commit b44221f
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 15 deletions.
7 changes: 1 addition & 6 deletions examples/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,8 @@ def select_repository(

def run_repository(repo_name: str) -> None:
repo_path = os.path.join(ROOT, repo_name)
requirements_path = os.path.join(repo_path, "requirements.txt")
run_script_path = (Path(repo_path) / "run.sh").resolve()

if os.path.exists(requirements_path):
subprocess.run(["pip", "install", "-r", requirements_path])

subprocess.run(["bash", run_script_path], cwd=repo_path)
subprocess.run(["magic", "run", "bash", run_script_path], cwd=repo_path)
return


Expand Down
2 changes: 1 addition & 1 deletion examples/inference/bert-c-torchscript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If you have [`magic`](https://docs.modular.com/magic), you can run the
following command:

```sh
magic run run.sh
magic run bash run.sh
```

### Conda instructions
Expand Down
2 changes: 1 addition & 1 deletion examples/inference/bert-mojo-torchscript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you have [`magic`](https://docs.modular.com/magic), you can run the
following command:

```sh
magic run run.sh
magic run bash run.sh
```

### Conda instructions
Expand Down
4 changes: 2 additions & 2 deletions examples/inference/bert-python-torchscript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ following command:

```sh
# Run the MAX Engine example
magic run run.sh
magic run bash run.sh
# Run the MAX Serving example
magic run deploy.sh
magic run bash deploy.sh
```

### Conda instructions
Expand Down
2 changes: 1 addition & 1 deletion examples/inference/mistral7b-python-onnx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ following command:

```sh
# Run the MAX Engine example
HF_TOKEN=<your-huggingface-user-token> magic run run.sh
HF_TOKEN=<your-huggingface-user-token> magic run bash run.sh
```

### Conda instructions
Expand Down
2 changes: 1 addition & 1 deletion examples/inference/resnet50-python-torchscript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you have [`magic`](https://docs.modular.com/magic), you can run the
following command:

```sh
magic run run.sh
magic run bash run.sh
```

### Conda instructions
Expand Down
2 changes: 1 addition & 1 deletion examples/inference/stable-diffusion-mojo-onnx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you have [`magic`](https://docs.modular.com/magic), you can run the
following command:

```sh
magic run run.sh
magic run bash run.sh
```

### Conda instructions
Expand Down
2 changes: 1 addition & 1 deletion examples/inference/stable-diffusion-python-onnx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you have [`magic`](https://docs.modular.com/magic), you can run the
following command:

```sh
magic run run.sh
magic run bash run.sh
```

### Conda instructions
Expand Down
2 changes: 1 addition & 1 deletion examples/inference/yolo-python-onnx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you have [`magic`](https://docs.modular.com/magic), you can run the
following command:

```sh
magic run run.sh
magic run bash run.sh
```

### Conda instructions
Expand Down

0 comments on commit b44221f

Please sign in to comment.