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
The current implementation of the configuration file loading when using the KServe wrapper is sub-optimal.
Based on the content of the __main__.py file, there are several defaults values that are in use however, if any of the corresponding keys are missing from the configuration file, a KeyError will get triggered and thus the execution will never reach the default value handling code.
The configuration loading also does not ignore lines starting with # as the file format defines.
Error logs
INFO:root:Wrapper: loading configuration from ts-config.conf
Traceback (most recent call last):
File "/path/to/pytorch-serve/kubernetes/kserve/kserve_wrapper/main.py", line 103, in
) = parse_config()
File "/path/to/pytorch-serve/kubernetes/kserve/kserve_wrapper/main.py", line 46, in parse_config
keys["model_snapshot"] = json.loads(keys["model_snapshot"])
KeyError: 'model_snapshot'
🐛 Describe the bug
The current implementation of the configuration file loading when using the KServe wrapper is sub-optimal.
Based on the content of the
__main__.py
file, there are several defaults values that are in use however, if any of the corresponding keys are missing from the configuration file, a KeyError will get triggered and thus the execution will never reach the default value handling code.The configuration loading also does not ignore lines starting with
#
as the file format defines.Error logs
INFO:root:Wrapper: loading configuration from ts-config.conf
Traceback (most recent call last):
File "/path/to/pytorch-serve/kubernetes/kserve/kserve_wrapper/main.py", line 103, in
) = parse_config()
File "/path/to/pytorch-serve/kubernetes/kserve/kserve_wrapper/main.py", line 46, in parse_config
keys["model_snapshot"] = json.loads(keys["model_snapshot"])
KeyError: 'model_snapshot'
Installation instructions
Installed torchserve from sources
Model Packaing
Using the mnist example
config.properties
enable_envvars_config=true
Versions
Environment headers
Torchserve branch:
torchserve==0.9.0
torch-model-archiver==0.9.0b20240224
Python version: 3.10 (64-bit runtime)
Python executable: /Users/home/miniconda3/envs/pytorch-serve-dev/bin/python
Versions of relevant python libraries:
captum==0.6.0
numpy==1.24.3
pillow==10.2.0
psutil==5.9.8
pygit2==1.13.3
pylint==3.0.3
pytest==7.3.1
pytest-cov==4.1.0
pytest-mock==3.12.0
requests==2.31.0
requests-oauthlib==1.3.1
requests-toolbelt==1.0.0
torch==2.2.1
torch-model-archiver==0.9.0b20240224
torch-workflow-archiver==0.2.11b20240224
torchaudio==2.2.1
torchdata==0.7.1
torchpippy==0.1.1
torchserve==0.9.0
torchtext==0.17.1
torchvision==0.17.1
transformers==4.38.1
wheel==0.42.0
torch==2.2.1
torchtext==0.17.1
torchvision==0.17.1
torchaudio==2.2.1
Java Version:
OS: Mac OSX 13.6.4 (arm64)
GCC version: N/A
Clang version: 15.0.0 (clang-1500.1.0.2.5)
CMake version: version 3.28.3
Versions of npm installed packages:
**Warning: newman, newman-reporter-html markdown-link-check not installed...
Repro instructions
Follow the mnist example and start torchserve
Create the properties file
Start the kserve wrapper
Possible Solution
For the default part, refactor the properties handling so that if a key is missing, the default value is used.
For the
#
add a check for that character before handling the line.The text was updated successfully, but these errors were encountered: