feat: add repo to collection by input

#13
by wseo - opened
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +4 -4
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: true
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, 11, tzinfo=timezone(timedelta(hours=9)))
28
 
29
 
30
- def has_contributions(repo_type, hf_username, organization, likes=5):
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((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
 
 
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