wseo-test commited on
Commit
f70205d
β€’
1 Parent(s): 0df7ae2

docs: leaderboard column

Browse files
Files changed (3) hide show
  1. .gitignore +2 -1
  2. app.py +52 -33
  3. hfkr_logo.png +0 -0
.gitignore CHANGED
@@ -1 +1,2 @@
1
- .env
 
 
1
+ .env
2
+ __pycache__
app.py CHANGED
@@ -69,10 +69,11 @@ def check_if_passed(hf_username):
69
  certificate_type = ""
70
 
71
  # If the user contributed to models, datasets and spaces then assign excellence
72
- if all(get_hub_footprint(hf_username, ORGANIZATION)):
 
73
  passed = True
74
  certificate_type = "excellence"
75
- elif any(get_hub_footprint(hf_username, ORGANIZATION)):
76
  passed = True
77
  certificate_type = "completion"
78
 
@@ -230,7 +231,7 @@ def create_certificate(passed, certificate_type, hf_username, first_name, last_n
230
  Since you contributed to at least one model, dataset, or space- you get a Certificate of Completion πŸŽ“.
231
  You can download your certificate below ⬇️
232
  https://huggingface.co/datasets/pseudolab/huggingface-krew-hackathon2023/resolve/main/certificates/{hf_username}.pdf\n
233
- Don't hesitate to share your certificate link above on Twitter and Linkedin (you can tag me @wonhseo, @pseudo-lab and @huggingface) πŸ€— \n
234
  You can try to get a Certificate of Excellence if you contribute to all types of repos, please don't hesitate to do so.
235
  """
236
  else:
@@ -263,36 +264,54 @@ def certification(hf_username, first_name, last_name):
263
 
264
  with gr.Blocks() as demo:
265
  gr.Markdown(
266
- f"""
267
- # Get your 2023 Hackathon Certificate πŸŽ“
268
- The certification process is completely free:
269
- - To get a *certificate of completion*: you need to **contribute to at least one model, dataset, or space**.
270
- - To get a *certificate of excellence*: you need to **contribute to models, datasets, and spaces**. *(Yes, all three!)*
271
-
272
- For more information about the certification process [check the hackathon page on certification](https://pseudo-lab.github.io/huggingface-hackathon23/submit.html#certification).
273
-
274
- Don't hesitate to share your certificate on Twitter (tag me [@wonhseo](https://twitter.com/wonhseo), [@pseudo-lab](https://twitter.com/pseudo-lab), and [@huggingface](https://twitter.com/huggingface)) and on LinkedIn.
275
- """
276
- )
277
-
278
- hf_username = gr.Textbox(
279
- placeholder="wseo", label="Your Hugging Face Username (case sensitive)"
280
- )
281
- first_name = gr.Textbox(placeholder="Wonhyeong", label="Your First Name")
282
- last_name = gr.Textbox(placeholder="Seo", label="Your Last Name")
283
-
284
- check_progress_button = gr.Button(value="Check if I pass and get the certificate")
285
- output_text = gr.components.Textbox(label="Your Result")
286
-
287
- with gr.Row(visible=True) as output_row:
288
- output_pdf = gr.File()
289
- output_img = gr.components.Image(type="pil")
290
-
291
- check_progress_button.click(
292
- fn=certification,
293
- inputs=[hf_username, first_name, last_name],
294
- outputs=[output_text, output_pdf, output_img, output_row],
295
  )
296
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
 
298
  demo.launch(debug=True)
 
69
  certificate_type = ""
70
 
71
  # If the user contributed to models, datasets and spaces then assign excellence
72
+ has_models, has_datasets, has_spaces = get_hub_footprint(hf_username, ORGANIZATION)
73
+ if all(has_models, has_datasets, has_spaces):
74
  passed = True
75
  certificate_type = "excellence"
76
+ elif any(has_models, has_datasets, has_spaces):
77
  passed = True
78
  certificate_type = "completion"
79
 
 
231
  Since you contributed to at least one model, dataset, or space- you get a Certificate of Completion πŸŽ“.
232
  You can download your certificate below ⬇️
233
  https://huggingface.co/datasets/pseudolab/huggingface-krew-hackathon2023/resolve/main/certificates/{hf_username}.pdf\n
234
+ Don't hesitate to share your certificate link above on Twitter and Linkedin (you can tag me @wonhseo and @huggingface) πŸ€—
235
  You can try to get a Certificate of Excellence if you contribute to all types of repos, please don't hesitate to do so.
236
  """
237
  else:
 
264
 
265
  with gr.Blocks() as demo:
266
  gr.Markdown(
267
+ '<img style="display: block; margin-left: auto; margin-right: auto; height: 10em;"'
268
+ ' src="file/hfkr_logo.png"/>\n\n'
269
+ '<h1 style="text-align: center;">Hugging Face KREW Hackathon 2023: Everyday AI</h1>'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  )
271
+ with gr.Row():
272
+ with gr.Column() as certificate_column:
273
+ gr.Markdown(
274
+ f"""
275
+ ## Get your 2023 Hackathon Certificate πŸŽ“
276
+ The certification process is completely free:
277
+ - To get a *certificate of completion*: you need to **contribute to at least one model, dataset, or space**.
278
+ - To get a *certificate of excellence*: you need to **contribute to models, datasets, and spaces**. *(Yes, all three!)*
279
+
280
+ 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).
281
+ 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.
282
+ """
283
+ )
284
+
285
+ hf_username = gr.Textbox(
286
+ placeholder="wseo", label="Your Hugging Face Username (case sensitive)"
287
+ )
288
+ first_name = gr.Textbox(placeholder="Wonhyeong", label="Your First Name")
289
+ last_name = gr.Textbox(placeholder="Seo", label="Your Last Name")
290
+
291
+ check_progress_button = gr.Button(value="Check if I pass and get the certificate")
292
+ output_text = gr.components.Textbox(label="Your Result")
293
+
294
+ with gr.Row(visible=True) as output_row:
295
+ output_pdf = gr.File()
296
+ output_img = gr.components.Image(type="pil")
297
+
298
+ check_progress_button.click(
299
+ fn=certification,
300
+ inputs=[hf_username, first_name, last_name],
301
+ outputs=[output_text, output_pdf, output_img, output_row],
302
+ )
303
+ with gr.Column() as leaderboard_column:
304
+ gr.Markdown(
305
+ f"""
306
+ ## ❀️ Leaderboard
307
+ The leaderboard showcases your contributions for easy sharing on SNS platforms:
308
+
309
+ - Event #1: *1 repo 1 share* - **share your contributions to the world!**
310
+ - (more on the way!)
311
+
312
+ For more information about the offline event [check our event-us page](https://event-us.kr/huggingfacekrew/event/72612).
313
+ Don't hesitate to share your contributions on Twitter (tag me [@wonhseo](https://twitter.com/wonhseo) and [@huggingface](https://twitter.com/huggingface)) and on LinkedIn.
314
+ """
315
+ )
316
 
317
  demo.launch(debug=True)
hfkr_logo.png ADDED