Closed koking0 closed 2 years ago
I was able to reproduce the issue. The cause is that the browser (tested Firefox, Chrome and Safari) was using OPTIONS to do a preflight check before PUT and DELETE request.
In this case, the OPTIONS request is:
OPTIONS http://123.125.8.44:18081/models/insurance_chat?minWorkers=2&maxWorkers=3
TS code currently doesn't handle OPTIONS for management API and will throw MethodNotAllowedException.
@koking0 Please change the cors_allowed_methods in config.properties to:
cors_allowed_methods=GET, POST, PUT, DELETE, OPTIONS
🐛 Describe the bug
I followed the HuggingFace example to deploy the GPT2 model, but a CORS error occurred when the front-end was called.
I configured it in
config.properties
according to the tutorial on the official website, and then restarted the Docker container, but it didn't seem to work.my
config.properties
file:inside Docker container:
The magic is that not all requests will report errors. The GET request to obtain the model list and the POST request to register the model will not report an error, but the PUT request to modify the model configuration and the DELETE request to delete the model will report an error. The most fatal thing is to make predictions. The POST request reports an error.
The front end uses axios to request to delete the model
Error logs
front-end request error:
Installation instructions
Model Packaing
config.properties
Versions
pip list:
docker images:
Repro instructions
I followed the HuggingFace example to deploy the GPT2 model.
Possible Solution
No response