OPRO-FT- config.json file not loaded -Andyrasika/Mistral7b-ORPO 
Author: andysingal
Pull request: no

### System Info

Copy-and-paste the text below in your GitHub issue and FILL OUT the two last points.

- `transformers` version: 4.39.3
- Platform: Linux-5.4.0-152-generic-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.22.2
- Safetensors version: 0.4.2
- Accelerate version: 0.29.2
- Accelerate config: 	not found
- PyTorch version (GPU?): 2.2.0+cu121 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: <fill in>
- Using distributed or parallel set-up in script?: <fill in>

### Who can help?

@pacman100  @arth

### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [X] My own task or dataset (give details below)

### Reproduction

```
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("Andyrasika/Mistral7b-ORPO")
tokenizer = AutoTokenizer.from_pretrained("Andyrasika/Mistral7b-ORPO")

# Apply chat template
query = [{'role': 'user', 'content': 'Hi! How are you doing?'}]
prompt = tokenizer.apply_chat_template(query, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors='pt')

# Generation with specific configurations
output = model.generate(
  **inputs,
  max_new_tokens=128,
  do_sample=True,
  temperature=0.7
)
response = tokenizer.batch_decode(output)
```
```
---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
File [/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py:304](https://wp7mz534ivzto6-8888.proxy.runpod.net/lab/tree/workspace/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py#line=303), in hf_raise_for_status(response, endpoint_name)
    303 try:
--> 304     response.raise_for_status()
    305 except HTTPError as e:

File [/usr/local/lib/python3.10/dist-packages/requests/models.py:1021](https://wp7mz534ivzto6-8888.proxy.runpod.net/lab/tree/workspace/usr/local/lib/python3.10/dist-packages/requests/models.py#line=1020), in Response.raise_for_status(self)
   1020 if http_error_msg:
-> 1021     raise HTTPError(http_error_msg, response=self)

HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/Andyrasika/Mistral7b-ORPO/resolve/main/config.json

The above exception was the direct cause of the following exception:

EntryNotFoundError                        Traceback (most recent call last)
File /usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py:398, in cached_file(path_or_repo_id, filename, cache_dir, force_download, resume_download, proxies, token, revision, local_files_only, subfolder, repo_type, user_agent, _raise_exceptions_for_gated_repo, _raise_exceptions_for_missing_entries, _raise_exceptions_for_connection_errors, _commit_hash, **deprecated_kwargs)
    396 try:
    397     # Load from URL or cache if already cached
--> 398     resolved_file = hf_hub_download(
    399         path_or_repo_id,
    400         filename,
    401         subfolder=None if len(subfolder) == 0 else subfolder,
    402         repo_type=repo_type,
    403         revision=revision,
    404         cache_dir=cache_dir,
    405         user_agent=user_agent,
    406         force_download=force_download,
    407         proxies=proxies,
    408         resume_download=resume_download,
    409         token=token,
    410         local_files_only=local_files_only,
    411     )
    412 except GatedRepoError as e:

File [/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py:119](https://wp7mz534ivzto6-8888.proxy.runpod.net/lab/tree/workspace/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py#line=118), in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs)
    117     kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs)
--> 119 return fn(*args, **kwargs)

File [/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py:1261](https://wp7mz534ivzto6-8888.proxy.runpod.net/lab/tree/workspace/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py#line=1260), in hf_hub_download(repo_id, filename, subfolder, repo_type, revision, library_name, library_version, cache_dir, local_dir, local_dir_use_symlinks, user_agent, force_download, force_filename, proxies, etag_timeout, resume_download, token, local_files_only, headers, legacy_cache_layout, endpoint)
   1260 try:
-> 1261     metadata = get_hf_file_metadata(
   1262         url=url,
   1263         token=token,
   1264         proxies=proxies,
   1265         timeout=etag_timeout,
   1266         library_name=library_name,
   1267         library_version=library_version,
   1268         user_agent=user_agent,
   1269     )
   1270 except EntryNotFoundError as http_error:
   1271     # Cache the non-existence of the file and raise

File [/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py:119](https://wp7mz534ivzto6-8888.proxy.runpod.net/lab/tree/workspace/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py#line=118), in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs)
    117     kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs)
--> 119 return fn(*args, **kwargs)

File [/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py:1674](https://wp7mz534ivzto6-8888.proxy.runpod.net/lab/tree/workspace/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py#line=1673), in get_hf_file_metadata(url, token, proxies, timeout, library_name, library_version, user_agent, headers)
   1673 # Retrieve metadata
-> 1674 r = _request_wrapper(
   1675     method="HEAD",
   1676     url=url,
   1677     headers=headers,
   1678     allow_redirects=False,
   1679     follow_relative_redirects=True,
   1680     proxies=proxies,
   1681     timeout=timeout,
   1682 )
   1683 hf_raise_for_status(r)

File [/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py:369](https://wp7mz534ivzto6-8888.proxy.runpod.net/lab/tree/workspace/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py#line=368), in _request_wrapper(method, url, follow_relative_redirects, **params)
    368 if follow_relative_redirects:
--> 369     response = _request_wrapper(
    370         method=method,
    371         url=url,
    372         follow_relative_redirects=False,
    373         **params,
    374     )
    376     # If redirection, we redirect only relative paths.
    377     # This is useful in case of a renamed repository.

File [/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py:393](https://wp7mz534ivzto6-8888.proxy.runpod.net/lab/tree/workspace/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py#line=392), in _request_wrapper(method, url, follow_relative_redirects, **params)
    392 response = get_session().request(method=method, url=url, **params)
--> 393 hf_raise_for_status(response)
    394 return response

File [/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py:315](https://wp7mz534ivzto6-8888.proxy.runpod.net/lab/tree/workspace/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py#line=314), in hf_raise_for_status(response, endpoint_name)
    314     message = f"{response.status_code} Client Error." + "\n\n" + f"Entry Not Found for url: {response.url}."
--> 315     raise EntryNotFoundError(message, response) from e
    317 elif error_code == "GatedRepo":

EntryNotFoundError: 404 Client Error. (Request ID: Root=1-6618e108-72db616954221f1f56af2d4e;daa6ae57-5cf3-426d-b8fb-af300b2271cf)

Entry Not Found for url: https://huggingface.co/Andyrasika/Mistral7b-ORPO/resolve/main/config.json.

The above exception was the direct cause of the following exception:

OSError                                   Traceback (most recent call last)
Cell In[13], line 3
      1 from transformers import AutoModelForCausalLM, AutoTokenizer
----> 3 model = AutoModelForCausalLM.from_pretrained("Andyrasika/Mistral7b-ORPO")
      4 tokenizer = AutoTokenizer.from_pretrained("Andyrasika/Mistral7b-ORPO")
      6 # Apply chat template

File [/usr/local/lib/python3.10/dist-packages/transformers/models/auto/auto_factory.py:523](https://wp7mz534ivzto6-8888.proxy.runpod.net/lab/tree/workspace/usr/local/lib/python3.10/dist-packages/transformers/models/auto/auto_factory.py#line=522), in _BaseAutoModelClass.from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs)
    520 if kwargs.get("quantization_config", None) is not None:
    521     _ = kwargs.pop("quantization_config")
--> 523 config, kwargs = AutoConfig.from_pretrained(
    524     pretrained_model_name_or_path,
    525     return_unused_kwargs=True,
    526     trust_remote_code=trust_remote_code,
    527     code_revision=code_revision,
    528     _commit_hash=commit_hash,
    529     **hub_kwargs,
    530     **kwargs,
    531 )
    533 # if torch_dtype=auto was passed here, ensure to pass it on
    534 if kwargs_orig.get("torch_dtype", None) == "auto":

File [/usr/local/lib/python3.10/dist-packages/transformers/models/auto/configuration_auto.py:1138](https://wp7mz534ivzto6-8888.proxy.runpod.net/lab/tree/workspace/usr/local/lib/python3.10/dist-packages/transformers/models/auto/configuration_auto.py#line=1137), in AutoConfig.from_pretrained(cls, pretrained_model_name_or_path, **kwargs)
   1135 trust_remote_code = kwargs.pop("trust_remote_code", None)
   1136 code_revision = kwargs.pop("code_revision", None)
-> 1138 config_dict, unused_kwargs = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs)
   1139 has_remote_code = "auto_map" in config_dict and "AutoConfig" in config_dict["auto_map"]
   1140 has_local_code = "model_type" in config_dict and config_dict["model_type"] in CONFIG_MAPPING

File [/usr/local/lib/python3.10/dist-packages/transformers/configuration_utils.py:631](https://wp7mz534ivzto6-8888.proxy.runpod.net/lab/tree/workspace/usr/local/lib/python3.10/dist-packages/transformers/configuration_utils.py#line=630), in PretrainedConfig.get_config_dict(cls, pretrained_model_name_or_path, **kwargs)
    629 original_kwargs = copy.deepcopy(kwargs)
    630 # Get config dict associated with the base config file
--> 631 config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs)
    632 if "_commit_hash" in config_dict:
    633     original_kwargs["_commit_hash"] = config_dict["_commit_hash"]

File [/usr/local/lib/python3.10/dist-packages/transformers/configuration_utils.py:686](https://wp7mz534ivzto6-8888.proxy.runpod.net/lab/tree/workspace/usr/local/lib/python3.10/dist-packages/transformers/configuration_utils.py#line=685), in PretrainedConfig._get_config_dict(cls, pretrained_model_name_or_path, **kwargs)
    682 configuration_file = kwargs.pop("_configuration_file", CONFIG_NAME)
    684 try:
    685     # Load from local folder or from cache or download from model Hub and cache
--> 686     resolved_config_file = cached_file(
    687         pretrained_model_name_or_path,
    688         configuration_file,
    689         cache_dir=cache_dir,
    690         force_download=force_download,
    691         proxies=proxies,
    692         resume_download=resume_download,
    693         local_files_only=local_files_only,
    694         token=token,
    695         user_agent=user_agent,
    696         revision=revision,
    697         subfolder=subfolder,
    698         _commit_hash=commit_hash,
    699     )
    700     commit_hash = extract_commit_hash(resolved_config_file, commit_hash)
    701 except EnvironmentError:
    702     # Raise any environment error raise by `cached_file`. It will have a helpful error message adapted to
    703     # the original exception.

File [/usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py:452](https://wp7mz534ivzto6-8888.proxy.runpod.net/lab/tree/workspace/usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py#line=451), in cached_file(path_or_repo_id, filename, cache_dir, force_download, resume_download, proxies, token, revision, local_files_only, subfolder, repo_type, user_agent, _raise_exceptions_for_gated_repo, _raise_exceptions_for_missing_entries, _raise_exceptions_for_connection_errors, _commit_hash, **deprecated_kwargs)
    450     if revision is None:
    451         revision = "main"
--> 452     raise EnvironmentError(
    453         f"{path_or_repo_id} does not appear to have a file named {full_filename}. Checkout "
    454         f"'https://huggingface.co/{path_or_repo_id}/{[revision](https://huggingface.co/%7Bpath_or_repo_id%7D/%7Brevision)}' for available files."
    455     ) from e
    456 except HTTPError as err:
    457     resolved_file = _get_cache_file_to_return(path_or_repo_id, full_filename, cache_dir, revision)

OSError: Andyrasika/Mistral7b-ORPO does not appear to have a file named config.json. Checkout 'https://huggingface.co/Andyrasika/Mistral7b-ORPO/main' for available files.
```

### Expected behavior

generate text 

Comments:
cc @ArthurZucker @younesbelkada 

Hi @andysingal 
Thanks for the issue ! In order for us to debug, can you make: https://huggingface.co/Andyrasika/Mistral7b-ORPO public?

> Hi @andysingal Thanks for the issue ! In order for us to debug, can you make: https://huggingface.co/Andyrasika/Mistral7b-ORPO public?

I just deleted the repo on huggingface, here is the code i ran... using Runpod 3090  https://github.com/AIAnytime/ORPO-Mistral-7B-Alignment/blob/main/ORPO%20FT.ipynb 

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.