# OSError: official is not a valid git identifier

**URL:** <https://discuss.huggingface.co/t/oserror-official-is-not-a-valid-git-identifier/26988>\
**Category:** Beginners\
**Created:** [November 30, 2022, 8:33am UTC](https://discuss.huggingface.co/t/oserror-official-is-not-a-valid-git-identifier/26988 "2022-11-30T08:33:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RustX](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@RustX](https://discuss.huggingface.co/u/RustX)\
**Post date:** [November 30, 2022, 8:33am UTC](https://discuss.huggingface.co/t/oserror-official-is-not-a-valid-git-identifier/26988/1 "2022-11-30T08:33:17Z")

</div>

I pushed my finetuned model from Colab to HuggingFace.  
But after creating .app file through gradio to test it I get the subject error.  
Can anybody figure it out what might I do wrong, please?  
Here is the full error:

```auto
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 239, in hf_raise_for_status
    response.raise_for_status()
  File "/home/user/.local/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/RustX/donut-base-finetuned-insurance/resolve/official/config.json

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/user/.local/lib/python3.8/site-packages/transformers/utils/hub.py", line 409, in cached_file
    resolved_file = hf_hub_download(
  File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 124, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 1067, in hf_hub_download
    metadata = get_hf_file_metadata(
  File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 124, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 1376, in get_hf_file_metadata
    hf_raise_for_status(r)
  File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 249, in hf_raise_for_status
    raise RevisionNotFoundError(message, response) from e
huggingface_hub.utils._errors.RevisionNotFoundError: 404 Client Error. (Request ID: 7w2PrtLECkEwwmHJfIFVs)

Revision Not Found for url: https://huggingface.co/RustX/donut-base-finetuned-insurance/resolve/official/config.json.
Invalid rev id: official

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "app.py", line 26, in <module>
    pretrained_model = DonutModel.from_pretrained("RustX/donut-base-finetuned-insurance")
  File "/home/user/.local/lib/python3.8/site-packages/donut/model.py", line 593, in from_pretrained
    model = super(DonutModel, cls).from_pretrained(pretrained_model_name_or_path, revision="official", *model_args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/transformers/modeling_utils.py", line 1966, in from_pretrained
    config, model_kwargs = cls.config_class.from_pretrained(
  File "/home/user/.local/lib/python3.8/site-packages/transformers/configuration_utils.py", line 532, in from_pretrained
    config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/transformers/configuration_utils.py", line 559, in get_config_dict
    config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/transformers/configuration_utils.py", line 614, in _get_config_dict
    resolved_config_file = cached_file(
  File "/home/user/.local/lib/python3.8/site-packages/transformers/utils/hub.py", line 431, in cached_file
    raise EnvironmentError(
OSError: official is not a valid git identifier (branch name, tag name or commit id) that exists for this model name. Check the model page at 'https://huggingface.co/RustX/donut-base-finetuned-insurance' for available revisions.

```

---

<div class="post-metadata">

**Author:** ![emisilab](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/emisilab/32/25178_2.png) [@emisilab](https://discuss.huggingface.co/u/emisilab)\
**Post date:** [March 27, 2024, 2:02am UTC](https://discuss.huggingface.co/t/oserror-official-is-not-a-valid-git-identifier/26988/2 "2024-03-27T02:02:32Z")

</div>

i have same problem with u, but now I cannot to solve the problem…  
or I have the reference of tutorial 🙂 [How to deal with OSError? - #4 by chris-rannou](https://discuss.huggingface.co/t/how-to-deal-with-oserror/27245/4)
