# rename a model

**URL:** <https://support.prodi.gy/t/rename-a-model/5241>\
**Category:** Uncategorized\
**Tags:** ner, spacy, training\
**Created:** [January 27, 2022, 3:26pm UTC](https://support.prodi.gy/t/rename-a-model/5241 "2022-01-27T15:26:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lize](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@Lize](https://support.prodi.gy/u/Lize)\
**Post date:** [January 27, 2022, 3:26pm UTC](https://support.prodi.gy/t/rename-a-model/5241/1 "2022-01-27T15:26:49Z")

</div>

Hi 🙂

I proceeded to the annotation of my texts, my dataset is called "textannotation".  
With these annotations I trained a model with the following command line

prodigy train ./models/fr\_contrat-de-travail/pipelines/1 --ner textannotation -es 0.3 --lang "fr" --label-stats

This created two folders for me: model-last and model-best. I want to generate a model under another name and with meta-information. So I modified the file "meta.json" as follows :

```python
{

"lang":"fr",

"name":"fr_ontrat_de_travail",

"version":"0.0.1",

"spacy_version":">=3.1.2,<3.2.0",

"description":"AI model for NER extractions",

"author":"Iloh IA team",

"email":"contact@iloh.fr",

"url":"https://www.iloh.fr/",

"license":"proprietary licences",

"spacy_git_version":"e1f88de72",

"vectors":{

"width":0,

"vectors":0,

"keys":0,

"name":null

},

```

This is what I want for my model.

I did this for model-last and model-best.

Then, I go to the next step, that is on spacy, with the following command line:

spacy train ./models/fr\_contrat de travail/pipelines/config\_init/config.cfg --output ./models/fr\_contrat de travail/pipelines/1/ --paths.train ./train --paths.dev ./dev

Here no problem.

Then when I want to generate the package all the information I modified is overwritten and my model is called again "fr\_pipeline" while I want to name it "fr\_contrat-de-travail".

I use the command line

spacy package ./models/fr\_contrat-de-travail/pipelines/1/model-last ./models/fr\_contrat-de-travail/package/1 -m ./models/fr\_contrat-de-travail/pipelines/1/model-last/meta.json

**How do we choose the name of our model and its meta-information?**

Thanks ! 🙂

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [January 27, 2022, 9:17pm UTC](https://support.prodi.gy/t/rename-a-model/5241/2 "2022-01-27T21:17:22Z")

</div>

Hi! Which version of spaCy are you using? If you're providing a `meta.json` on the CLI with `spacy package`, this information should be used for the final pipeline.

> [@Lize](#):
>
> `"name":"fr_ontrat_de_travail",`

One quick thing to note here: You shouldn't need to include the language code in the name, this will be added automatically. So the language can be `fr` and the model name `ontrat_de_travail`, which will end up as `fr_ontrat_de_travail`.

---

<div class="post-metadata">

**Author:** ![Lize](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@Lize](https://support.prodi.gy/u/Lize)\
**Post date:** [January 28, 2022, 1:58pm UTC](https://support.prodi.gy/t/rename-a-model/5241/3 "2022-01-28T13:58:51Z")

</div>

HI !

I am using spacy's version 3.1.2

I give a meta.json in my CLI as you can see.

> [@Lize](#):
>
> spacy package ./models/fr\_contrat-de-travail/pipelines/1/model-last ./models/fr\_contrat-de-travail/package/1 -m ./models/fr\_contrat-de-travail/pipelines/1/model-last/meta.json

These is the meta.json that is generate when I do prodigy train, and then I modify the file and give the meta-informations that I want and I save it.  
Then I do spacy train and spacy package and my meta.json is empty like I never did the modifications.  
I don't understand.

thanks for help !

---

<div class="post-metadata">

**Author:** ![Lize](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@Lize](https://support.prodi.gy/u/Lize)\
**Post date:** [February 1, 2022, 8:23am UTC](https://support.prodi.gy/t/rename-a-model/5241/4 "2022-02-01T08:23:06Z")

</div>

@ines

---

<div class="post-metadata">

**Author:** ![ljvmiranda921](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ljvmiranda921/32/3197_2.png) [@ljvmiranda921](https://support.prodi.gy/u/ljvmiranda921)\
**Post date:** [February 2, 2022, 5:45am UTC](https://support.prodi.gy/t/rename-a-model/5241/5 "2022-02-02T05:45:25Z")

</div>

Hi there, so just to make sure I understand correctly, are you updating `meta.json` before training? Can you try: training the model first, update `meta.json`, then call `spacy package`?

I also noticed that the `meta.json` you're passing is just inside the same directory as your model. It will still work even if you don't provide that path. You can edit `meta.json` and then call `spacy package`.

---

<div class="post-metadata">

**Author:** ![Lize](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@Lize](https://support.prodi.gy/u/Lize)\
**Post date:** [February 2, 2022, 9:14am UTC](https://support.prodi.gy/t/rename-a-model/5241/6 "2022-02-02T09:14:54Z")

</div>

Hi ! 🙂

I update the _meta.json_ after _prodigy train_.

I train my model with _prodigy train ./models/fr\_contrat-de-travail/pipelines/1 --ner textannotation -es 0.3 --lang "fr" --label-stats_

Then I modify _meta.json_ in model-last and best. I change max epochs in _config.cfg_

Then I do spacy train with _spacy train ./models/fr\_contrat-de-travail/pipelines/1/model-last/config.cfg --output ./models/fr\_contrat-de-travail/pipelines/1/ --paths.train ./train --[paths.dev](http://paths.dev/) ./dev_

and i do spacy package, I tried with files in the same directory and my model is still name "fr\_pipeline" 😤. My meta files are empty, as I never modified them.  
_spacy package ./models/fr\_contrat-de-travail/pipelines/1/model-last ./models/fr\_contrat-de-travail/package/1 -m ./models/fr\_contrat-de-travail/pipelines/1/model-last/meta.json_

---

<div class="post-metadata">

**Author:** ![Lize](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@Lize](https://support.prodi.gy/u/Lize)\
**Post date:** [February 2, 2022, 9:18am UTC](https://support.prodi.gy/t/rename-a-model/5241/7 "2022-02-02T09:18:09Z")

</div>

> I also noticed that the `meta.json` you're passing is just inside the same directory as your model. It will still work even if you don't provide that path. You can edit `meta.json` and then call `spacy package` .

I will try without giving the path and modify meta.json after spacy package
