Skip to content

Commit

Permalink
Catch HFValidationError in TrainingSummary (huggingface#19252)
Browse files Browse the repository at this point in the history
* Catch HfValidationError in TrainingSummary

Co-authored-by: ydshieh <[email protected]>
  • Loading branch information
ydshieh and ydshieh authored Sep 30, 2022
1 parent f3d2f7a commit 4fd32a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/transformers/modelcard.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import requests
import yaml
from huggingface_hub import model_info
from huggingface_hub.utils import HFValidationError

from . import __version__
from .models.auto.modeling_auto import (
Expand Down Expand Up @@ -378,7 +379,7 @@ def __post_init__(self):
for tag in info.tags:
if tag.startswith("license:"):
self.license = tag[8:]
except requests.exceptions.HTTPError:
except (requests.exceptions.HTTPError, HFValidationError):
pass

def create_model_index(self, metric_mapping):
Expand Down

0 comments on commit 4fd32a1

Please sign in to comment.