modularml / max

A collection of sample programs, notebooks, and tools which highlight the power of the MAX Platform
https://www.modular.com
Other
379 stars 50 forks source link

[BUG]: Max Serve Deploy.sh IndexError #182

Open anthony-chaudhary opened 5 months ago

anthony-chaudhary commented 5 months ago

Bug description

When running python3 triton-inference.py --input "Paris is the [MASK] of France." the following is returned:

Processing input...
Input processed.

Executing model...
Model executed.

Traceback (most recent call last):
  File "/home/anthony/max/examples/inference/bert-python-torchscript/triton-inference.py", line 121, in <module>
    main()
  File "/home/anthony/max/examples/inference/bert-python-torchscript/triton-inference.py", line 104, in main
    logits = torch.from_numpy(outputs[0, masked_index, :])
IndexError: too many indices for array: array is 2-dimensional, but 3 were indexed

image

Steps to reproduce

Follow instructions from https://docs.modular.com/max/serve/get-started with the system info mentioned in other sections

System information

- WSL 2
- Latest image `public.ecr.aws/modular/max-serving-de:latest`
- Instructions from https://docs.modular.com/max/serve/get-started
- Last commit SHA f2f49795d6f27039d24c14d92168c7892c3b2b49
- https://github.com/modularml/max/blob/main/examples/inference/bert-python-torchscript/deploy.sh
iamtimdavis commented 4 months ago

@navroopbath - are you able to take a look?