# Rasa API replace curently loaded model

**URL:** <https://forum.rasa.com/t/rasa-api-replace-curently-loaded-model/19906>\
**Category:** Rasa Open Source\
**Created:** [October 16, 2019, 3:01pm UTC](https://forum.rasa.com/t/rasa-api-replace-curently-loaded-model/19906 "2019-10-16T15:01:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![thom](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@thom](https://forum.rasa.com/u/thom)\
**Post date:** [October 16, 2019, 3:01pm UTC](https://forum.rasa.com/t/rasa-api-replace-curently-loaded-model/19906/1 "2019-10-16T15:01:52Z")

</div>

Hello everyone.

Im trying to load others trained nlu models during conversations, i have found the API page that provide the “model” endpoint with PUT method.

> **[Rasa & Rasa Pro Documentation](https://rasa.com/docs/rasa/pages/http-api/)**

But i found your error tracking quite hard to understand.

Application side i perform curl command:

```
curl -X PUT http://localhost:5005/model -H 'Content-type: application/json' -d '{"model_file":"/models/prestataire.tar.gz","model_server":{"url":"string","params":{ },"headers":{ },"basic_auth":{ },"token":"string","token_name":"string","wait_time_between_pulls":0},"remote_storage":"None"}'

```

response is:

```
{"version":"1.3.8","status":"failure","message":"An unexpected error occurred. Error: string","reason":"LoadingError","details":{},"help":null,"code":500}

```

Ok error 500. no probleme.

But Rasa side i have this:

```
rasa_1 | 2019-10-16 14:55:23 ERROR rasa.core.agent - Could not load model due to string.

```

This is this line i fully not understand. can you tell me what is wrong.

Model folder:

```
$ pwd
<....>/dockerrasa/models
$ ls
default.tar.gz prestataire.tar.gz

```

The cause of this error is “remove\_storage” field is an enum and None isn’t in. but i don’t want to use remote storage or model server. So i perform this line:

```
curl -X PUT http://localhost:5005/model -H 'Content-type: application/json' -d '{"model_file":"/models/prestataire.tar.gz"}'

```

Response is:

```
{"version":"1.3.8","status":"failure","message":"Agent with name '\/models\/prestataire.tar.gz' could not be loaded.","reason":"BadRequest","details":{"parameter":"model","in":"query"},"help":null,"code":400}

```

Edit: i use docker compose

Both models are trainned using docker command:

```
docker run -v $(pwd):/app rasa/rasa:latest-full train --domain domain.yml --data data --out models --config config.yml --fixed-model-name default 

docker run -v $(pwd):/app rasa/rasa:latest-full train --domain domain.yml --data data_prestataire --out models --config config.yml --fixed-model-name prestataire

$ ls data_prestataire
nlu.md

```

---

<div class="post-metadata">

**Author:** ![matthiask](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@matthiask](https://forum.rasa.com/u/matthiask)\
**Post date:** [October 17, 2019, 7:27am UTC](https://forum.rasa.com/t/rasa-api-replace-curently-loaded-model/19906/2 "2019-10-17T07:27:57Z")

</div>

Try out

> curl -X PUT [http://localhost:5005/model](http://localhost:5005/model) -H ‘Content-type: application/json’ -d ‘{“model\_file”:“/app/models/prestataire.tar.gz”,}’

You need to provide the absolute path of the model.

---

<div class="post-metadata">

**Author:** ![sadque](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@sadque](https://forum.rasa.com/u/sadque)\
**Post date:** [May 22, 2020, 8:43am UTC](https://forum.rasa.com/t/rasa-api-replace-curently-loaded-model/19906/3 "2020-05-22T08:43:25Z")

</div>

Any idea how to use it with “remote\_storage”:“aws”?

---

<div class="post-metadata">

**Author:** ![ShirudeAkash](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/shirudeakash/32/20340_2.png) [@ShirudeAkash](https://forum.rasa.com/u/ShirudeAkash)\
**Post date:** [May 12, 2022, 9:44am UTC](https://forum.rasa.com/t/rasa-api-replace-curently-loaded-model/19906/4 "2022-05-12T09:44:17Z")

</div>

same question, did you found any answer for this?

---

<div class="post-metadata">

**Author:** ![keyrasa2023](https://avatars.discourse-cdn.com/v4/letter/k/87869e/32.png) [@keyrasa2023](https://forum.rasa.com/u/keyrasa2023)\
**Post date:** [July 3, 2023, 2:44am UTC](https://forum.rasa.com/t/rasa-api-replace-curently-loaded-model/19906/5 "2023-07-03T02:44:44Z")

</div>

please, give me a guide about the absolute path of the model. I used path “D:/ChatbotCode/ProjectChatBot/CreateChatBot/models/20230629-094247-excited-message.tar.gz”. But Server still response the message which is "“Agent with name ‘D:/ChatbotCode/ProjectChatBot/CreateChatBot/models/20230629-094247-excited-message.tar.gz’ could not be loaded.”. Please Help me. Thanks a lot
