feat: offline participation
#11
by
wseo
- opened
README.md
CHANGED
@@ -6,7 +6,7 @@ colorTo: yellow
|
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.36.1
|
8 |
app_file: app.py
|
9 |
-
pinned:
|
10 |
---
|
11 |
|
12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.36.1
|
8 |
app_file: app.py
|
9 |
+
pinned: false
|
10 |
---
|
11 |
|
12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
CHANGED
@@ -24,10 +24,10 @@ CERTIFIED_USERS_FILENAME = "certified.csv"
|
|
24 |
ORGANIZATION = "pseudolab"
|
25 |
|
26 |
START_DATE = datetime(2023, 10, 20, tzinfo=timezone(timedelta(hours=9)))
|
27 |
-
END_DATE = datetime(2023, 11,
|
28 |
|
29 |
|
30 |
-
def has_contributions(repo_type, hf_username, organization, likes=
|
31 |
"""
|
32 |
Check if a user has contributions in the specified repository type.
|
33 |
:param repo_type: A repo type supported by the Hub
|
@@ -74,10 +74,10 @@ def check_if_passed(hf_username):
|
|
74 |
|
75 |
# If the user contributed to models, datasets and spaces then assign excellence
|
76 |
has_models, has_datasets, has_spaces = get_hub_footprint(hf_username, ORGANIZATION)
|
77 |
-
if all(
|
78 |
passed = True
|
79 |
certificate_type = "excellence"
|
80 |
-
elif any(
|
81 |
passed = True
|
82 |
certificate_type = "completion"
|
83 |
|
@@ -244,7 +244,7 @@ def create_certificate(passed, certificate_type, hf_username, first_name, last_n
|
|
244 |
pdf = "./fail.pdf"
|
245 |
# Add a message
|
246 |
message = """
|
247 |
-
You didn't pass the minimum of one contribution to
|
248 |
For more information about the certification process, refer to the hackathon page.
|
249 |
If the results here differ from your contributions, make sure you moved your space to the pseudolab organization.
|
250 |
"""
|
@@ -346,7 +346,7 @@ with gr.Blocks() as demo:
|
|
346 |
- To get a *certificate of completion*: you need to **contribute to at least one model, dataset, or space**.
|
347 |
- To get a *certificate of excellence*: you need to **contribute to models, datasets, and spaces**. *(Yes, all three!)*
|
348 |
|
349 |
-
For more information about the certification process [check the hackathon page on certification](https://pseudo-lab.github.io/huggingface-hackathon23/
|
350 |
Don't hesitate to share your certificate on Twitter (tag me [@wonhseo](https://twitter.com/wonhseo) and [@huggingface](https://twitter.com/huggingface)) and on LinkedIn.
|
351 |
"""
|
352 |
)
|
|
|
24 |
ORGANIZATION = "pseudolab"
|
25 |
|
26 |
START_DATE = datetime(2023, 10, 20, tzinfo=timezone(timedelta(hours=9)))
|
27 |
+
END_DATE = datetime(2023, 11, 10, tzinfo=timezone(timedelta(hours=9)))
|
28 |
|
29 |
|
30 |
+
def has_contributions(repo_type, hf_username, organization, likes=10):
|
31 |
"""
|
32 |
Check if a user has contributions in the specified repository type.
|
33 |
:param repo_type: A repo type supported by the Hub
|
|
|
74 |
|
75 |
# If the user contributed to models, datasets and spaces then assign excellence
|
76 |
has_models, has_datasets, has_spaces = get_hub_footprint(hf_username, ORGANIZATION)
|
77 |
+
if all(has_models, has_datasets, has_spaces):
|
78 |
passed = True
|
79 |
certificate_type = "excellence"
|
80 |
+
elif any(has_models, has_datasets, has_spaces):
|
81 |
passed = True
|
82 |
certificate_type = "completion"
|
83 |
|
|
|
244 |
pdf = "./fail.pdf"
|
245 |
# Add a message
|
246 |
message = """
|
247 |
+
You didn't pass the minimum of one contribution to get a certificate of completion.
|
248 |
For more information about the certification process, refer to the hackathon page.
|
249 |
If the results here differ from your contributions, make sure you moved your space to the pseudolab organization.
|
250 |
"""
|
|
|
346 |
- To get a *certificate of completion*: you need to **contribute to at least one model, dataset, or space**.
|
347 |
- To get a *certificate of excellence*: you need to **contribute to models, datasets, and spaces**. *(Yes, all three!)*
|
348 |
|
349 |
+
For more information about the certification process [check the hackathon page on certification](https://pseudo-lab.github.io/huggingface-hackathon23/tutorials/project-roadmap.html#certification).
|
350 |
Don't hesitate to share your certificate on Twitter (tag me [@wonhseo](https://twitter.com/wonhseo) and [@huggingface](https://twitter.com/huggingface)) and on LinkedIn.
|
351 |
"""
|
352 |
)
|