@ShirudeAkash I didn’t have to delete the old model, it just swapped out the new one.
The only difference I see is that I have headers in my call, everything else looks prett much the same
My code actually trains a new model then swaps it out in the same script. So I get the model info from the training_results.model
which is actually models/whatever-the-mode-is-named.tar.gz
then I build the model_file
complete absolute path and use that value in my data json object
model_path = training_results.model
model_file = '/rasa/mlflow-rasa/{}'.format(model_path)
rasa_server_url = 'http://localhost:5005/model'
headers = {'Content-Type': 'application/json'}
data = {
"model_file":'{}'.format(model_file)
}
request = requests.put(rasa_server_url, headers=headers, data=json.dumps(data), verify=False)
You mention in your comments you’re getting a 200 code, are you certain it didn’t swap out the model?
I ran rasa run -m models --enable-api --log-file out.log --cors "*" --endpoints endpoints-local.yml --credentials credentials.yml --debug
so I could see it working when the new model was injected