Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Added trace printing in logs
Browse files
src/submission/check_validity.py
CHANGED
@@ -3,6 +3,7 @@ import os
|
|
3 |
import re
|
4 |
from collections import defaultdict
|
5 |
from datetime import datetime, timedelta, timezone
|
|
|
6 |
|
7 |
import huggingface_hub
|
8 |
from huggingface_hub import ModelCard
|
@@ -44,10 +45,12 @@ def is_model_on_hub(model_name: str, revision: str, token: str = None, trust_rem
|
|
44 |
None
|
45 |
)
|
46 |
except Exception as e:
|
|
|
47 |
return (False, "'s tokenizer cannot be loaded. Is your tokenizer class in a stable transformers release, and correctly configured?", None)
|
48 |
return True, None, config
|
49 |
|
50 |
-
except ValueError:
|
|
|
51 |
return (
|
52 |
False,
|
53 |
"needs to be launched with `trust_remote_code=True`. For safety reason, we do not allow these models to be automatically submitted to the leaderboard.",
|
@@ -55,6 +58,7 @@ def is_model_on_hub(model_name: str, revision: str, token: str = None, trust_rem
|
|
55 |
)
|
56 |
|
57 |
except Exception as e:
|
|
|
58 |
return False, "was not found on hub!", None
|
59 |
|
60 |
|
|
|
3 |
import re
|
4 |
from collections import defaultdict
|
5 |
from datetime import datetime, timedelta, timezone
|
6 |
+
import traceback
|
7 |
|
8 |
import huggingface_hub
|
9 |
from huggingface_hub import ModelCard
|
|
|
45 |
None
|
46 |
)
|
47 |
except Exception as e:
|
48 |
+
traceback.print_exception(e)
|
49 |
return (False, "'s tokenizer cannot be loaded. Is your tokenizer class in a stable transformers release, and correctly configured?", None)
|
50 |
return True, None, config
|
51 |
|
52 |
+
except ValueError as e:
|
53 |
+
traceback.print_exception(e)
|
54 |
return (
|
55 |
False,
|
56 |
"needs to be launched with `trust_remote_code=True`. For safety reason, we do not allow these models to be automatically submitted to the leaderboard.",
|
|
|
58 |
)
|
59 |
|
60 |
except Exception as e:
|
61 |
+
traceback.print_exception(e)
|
62 |
return False, "was not found on hub!", None
|
63 |
|
64 |
|