yonikremer
commited on
Commit
·
45e9ce6
1
Parent(s):
99ced83
added a organizations black-list
Browse files- supported_models.py +8 -2
supported_models.py
CHANGED
@@ -14,6 +14,9 @@ BLACKLISTED_MODEL_NAMES = {
|
|
14 |
"bigscience/mt0-base",
|
15 |
"bigscience/mt0-small",
|
16 |
}
|
|
|
|
|
|
|
17 |
DEFAULT_MIN_NUMBER_OF_DOWNLOADS = 100
|
18 |
DEFAULT_MIN_NUMBER_OF_LIKES = 20
|
19 |
|
@@ -83,6 +86,9 @@ def card_filter(
|
|
83 |
"""returns True if the model card is valid, False otherwise"""
|
84 |
if model_name in BLACKLISTED_MODEL_NAMES:
|
85 |
return False
|
|
|
|
|
|
|
86 |
numeric_contents = get_numeric_contents(model_card)
|
87 |
if len(numeric_contents) < 2:
|
88 |
# If the model card doesn't have at least 2 numeric contents,
|
@@ -120,7 +126,7 @@ def generate_supported_model_names(
|
|
120 |
min_number_of_likes: int,
|
121 |
) -> Generator[str, None, None]:
|
122 |
with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
|
123 |
-
future_to_index = {executor.submit(get_page, index): index for index in range(
|
124 |
for future in as_completed(future_to_index):
|
125 |
soup = future.result()
|
126 |
if soup:
|
@@ -142,6 +148,6 @@ def get_supported_model_names(
|
|
142 |
|
143 |
|
144 |
if __name__ == "__main__":
|
145 |
-
supported_model_names = get_supported_model_names()
|
146 |
print(f"Number of supported model names: {len(supported_model_names)}")
|
147 |
print(f"Supported model names: {supported_model_names}")
|
|
|
14 |
"bigscience/mt0-base",
|
15 |
"bigscience/mt0-small",
|
16 |
}
|
17 |
+
BLACKLISTED_ORGANIZATIONS = {
|
18 |
+
"huggingtweets"
|
19 |
+
}
|
20 |
DEFAULT_MIN_NUMBER_OF_DOWNLOADS = 100
|
21 |
DEFAULT_MIN_NUMBER_OF_LIKES = 20
|
22 |
|
|
|
86 |
"""returns True if the model card is valid, False otherwise"""
|
87 |
if model_name in BLACKLISTED_MODEL_NAMES:
|
88 |
return False
|
89 |
+
organization = model_name.split("/")[0]
|
90 |
+
if organization in BLACKLISTED_ORGANIZATIONS:
|
91 |
+
return False
|
92 |
numeric_contents = get_numeric_contents(model_card)
|
93 |
if len(numeric_contents) < 2:
|
94 |
# If the model card doesn't have at least 2 numeric contents,
|
|
|
126 |
min_number_of_likes: int,
|
127 |
) -> Generator[str, None, None]:
|
128 |
with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
|
129 |
+
future_to_index = {executor.submit(get_page, index): index for index in range(300)}
|
130 |
for future in as_completed(future_to_index):
|
131 |
soup = future.result()
|
132 |
if soup:
|
|
|
148 |
|
149 |
|
150 |
if __name__ == "__main__":
|
151 |
+
supported_model_names = get_supported_model_names(1, 1)
|
152 |
print(f"Number of supported model names: {len(supported_model_names)}")
|
153 |
print(f"Supported model names: {supported_model_names}")
|