huggingface / autotrain-advanced

🤗 AutoTrain Advanced
https://huggingface.co/autotrain
Apache License 2.0
3.63k stars 441 forks source link

[BUG] Invalid YAML in README.md error after fine tuning is completed #651

Closed shahshrey closed 1 month ago

shahshrey commented 1 month ago

Prerequisites

Backend

Hugging Face Space/Endpoints

Interface Used

UI

CLI Command

No response

UI Screenshots & Parameters

{ "block_size": 1024, "model_max_length": 2048, "mixed_precision": "fp16", "lr": 0.00003, "epochs": 1, "batch_size": 10, "gradient_accumulation": 1, "optimizer": "adamw_torch", "scheduler": "linear", "chat_template": "none", "target_modules": "all-linear", "peft": true }

Error Logs

100%|██████████| 5/5 [01:07<00:00, 13.44s/it] 100%|██████████| 5/5 [01:07<00:00, 13.52s/it] INFO | 2024-05-21 19:50:15 | autotrain.trainers.clm.utils:post_training_steps:281 - Finished training, saving model... INFO: 10.16.41.118:28866 - "GET /ui/is_model_training HTTP/1.1" 200 OK INFO | 2024-05-21 19:50:18 | autotrain.trainers.clm.utils:post_training_steps:311 - Pushing model to hub... INFO: 10.16.15.199:21721 - "GET /ui/logs HTTP/1.1" 200 OK ERROR | 2024-05-21 19:50:18 | autotrain.trainers.common:wrapper:120 - train has failed due to an exception: Traceback (most recent call last): File "/app/env/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 304, in hf_raise_for_status response.raise_for_status() File "/app/env/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://huggingface.co/api/validate-yaml

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

Traceback (most recent call last): File "/app/env/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 3761, in create_commit hf_raise_for_status(response) File "/app/env/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 358, in hf_raise_for_status raise BadRequestError(message, response=response) from e huggingface_hub.utils._errors.BadRequestError: (Request ID: Root=1-664cfafa-45bc71e3421709a5683f6d88;1929963f-f4bc-4d51-8eb2-a76192e1501e)

Bad request: Invalid YAML in README.md: end of the stream or a document separator is expected (12:1)

9 | - role: user 10 | content: What is your f ... 11 | license: other 12 | - dataset: shreyshah/ext_dataset ------^

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

Traceback (most recent call last): File "/app/env/lib/python3.10/site-packages/autotrain/trainers/common.py", line 117, in wrapper return func(*args, kwargs) File "/app/env/lib/python3.10/site-packages/autotrain/trainers/clm/main.py", line 28, in train train_sft(config) File "/app/env/lib/python3.10/site-packages/autotrain/trainers/clm/train_clm_sft.py", line 99, in train utils.post_training_steps(config, trainer) File "/app/env/lib/python3.10/site-packages/autotrain/trainers/clm/utils.py", line 317, in post_training_steps api.upload_folder( File "/app/env/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 119, in _inner_fn return fn(*args, *kwargs) File "/app/env/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 1230, in _inner return fn(self, args, kwargs) File "/app/env/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 4807, in upload_folder commit_info = self.create_commit( File "/app/env/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 119, in _inner_fn return fn(*args, *kwargs) File "/app/env/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 1230, in _inner return fn(self, args, **kwargs) File "/app/env/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 3765, in create_commit raise ValueError(f"Invalid metadata in README.md.\n{message}") from e ValueError: Invalid metadata in README.md.

Additional Information

Running this one nvidia 4 x l4 on HF spaces. Tried with different datasets

abhishekkrthakur commented 1 month ago

fixed in version 0.7.101 and above. thanks for reporting. apologies for the inconvenience.