You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Request abstraction from serving SDK, attempt to call getInputStream() will throw an exception if underlying buffer is a direct buffer.
Error logs
direct buffer
java.lang.UnsupportedOperationException: direct buffer
at io.netty.buffer.UnpooledDirectByteBuf.array(UnpooledDirectByteBuf.java:181)
at org.pytorch.serve.servingsdk.impl.ModelServerRequest.getInputStream(ModelServerRequest.java:49)
at org.pytorch.serve.servingsdk.impl.ModelServerRequest.getInputStream(ModelServerRequest.java:13)
Installation instructions
Reproducible both in Docker and when installing from source
🐛 Describe the bug
When using Request abstraction from serving SDK, attempt to call
getInputStream()
will throw an exception if underlying buffer is a direct buffer.Error logs
direct buffer
java.lang.UnsupportedOperationException: direct buffer
at io.netty.buffer.UnpooledDirectByteBuf.array(UnpooledDirectByteBuf.java:181)
at org.pytorch.serve.servingsdk.impl.ModelServerRequest.getInputStream(ModelServerRequest.java:49)
at org.pytorch.serve.servingsdk.impl.ModelServerRequest.getInputStream(ModelServerRequest.java:13)
Installation instructions
Reproducible both in Docker and when installing from source
Model Packaing
Works with any model
config.properties
inference_address=http://0.0.0.0:8080
management_address=http://0.0.0.0:8081
metrics_address=http://0.0.0.0:8082
load_models=all
model_store=/home/model-server/model-store
plugins_path=/home/model-server/plugins
default_workers_per_model=4
Versions
Environment headers
Torchserve branch:
torchserve==0.8.1b20230724
torch-model-archiver==0.8.1b20230724
Python version: 3.10 (64-bit runtime)
Python executable: ./serve/venv/bin/python
Versions of relevant python libraries:
captum==0.6.0
numpy==1.24.3
psutil==5.9.5
pygit2==1.12.1
pylint==2.6.0
pytest==7.3.1
pytest-cov==4.1.0
pytest-mock==3.10.0
requests==2.31.0
requests-toolbelt==1.0.0
torch==2.0.1
torch-model-archiver==0.8.1b20230724
torch-workflow-archiver==0.2.9b20230724
torchaudio==2.0.2
torchdata==0.6.1
torchpippy==0.1.1
torchserve==0.8.1b20230724
torchtext==0.15.2
torchvision==0.15.2
transformers==4.30.0
wheel==0.41.0
torch==2.0.1
torchtext==0.15.2
torchvision==0.15.2
torchaudio==2.0.2
Java Version:
OS: Mac OSX 13.4.1 (arm64)
GCC version: N/A
Clang version: 14.0.3 (clang-1403.0.22.14.1)
CMake version: version 3.26.4
Versions of npm installed packages:
markdown-link-check@3.11.2
UNMET PEER DEPENDENCY newman@5.3.2
newman-reporter-html@1.0.5
Repro instructions
A test that reproduces the issue:
Possible Solution
Use
NettyUtils.getBytes()
in relevant methodThe method would look like this:
The test above no longer throws an exception with this fix.
The text was updated successfully, but these errors were encountered: