burtenshaw commited on
Commit
c6b4c88
·
1 Parent(s): 71970d8

re-add huggingface hub

Browse files
Files changed (2) hide show
  1. app.py +7 -5
  2. pyproject.toml +1 -0
app.py CHANGED
@@ -6,6 +6,7 @@ import tempfile
6
 
7
  import gradio as gr
8
  from PIL import Image, ImageDraw, ImageFont
 
9
 
10
  from criteria import check_certification as check_certification_criteria
11
  from org import join_finishers_org
@@ -52,6 +53,7 @@ def generate_certificate(
52
 
53
  return im, "certificate.pdf"
54
 
 
55
  def create_linkedin_button(username: str, cert_url: str | None) -> str:
56
  """Create LinkedIn 'Add to Profile' button HTML."""
57
  current_year = date.today().year
@@ -144,8 +146,7 @@ def check_certification(token: gr.OAuthToken | None, profile: gr.OAuthProfile |
144
  except IndexError:
145
  last_name = ""
146
  profile_url = profile.picture
147
-
148
- if not username:
149
  return (
150
  "Please login with your Hugging Face account to check certification status",
151
  None,
@@ -184,14 +185,16 @@ def check_certification(token: gr.OAuthToken | None, profile: gr.OAuthProfile |
184
 
185
 
186
  with gr.Blocks() as demo:
187
- gr.Markdown("""
 
188
  # Get your Certificate of Fundamentals of Agents 🎓
189
  The certification process is completely free.
190
 
191
  To earn this certificate, you need to complete <a href="https://hf.co/learn/agents-course/unit1/introduction" alt="Agent Course Unit 1"/>Unit 1 of the Agents Course</a> and **pass 80% of the final quiz**.
192
 
193
  Once you receive your certificate, don’t hesitate to share it on X (and tag @huggingface) as well as on LinkedIn so that we can congratulate you.
194
- """)
 
195
 
196
  # Add login button
197
  gr.LoginButton().activate()
@@ -209,6 +212,5 @@ with gr.Blocks() as demo:
209
  )
210
 
211
 
212
-
213
  if __name__ == "__main__":
214
  demo.launch(debug=True)
 
6
 
7
  import gradio as gr
8
  from PIL import Image, ImageDraw, ImageFont
9
+ from huggingface_hub import upload_file
10
 
11
  from criteria import check_certification as check_certification_criteria
12
  from org import join_finishers_org
 
53
 
54
  return im, "certificate.pdf"
55
 
56
+
57
  def create_linkedin_button(username: str, cert_url: str | None) -> str:
58
  """Create LinkedIn 'Add to Profile' button HTML."""
59
  current_year = date.today().year
 
146
  except IndexError:
147
  last_name = ""
148
  profile_url = profile.picture
149
+ if not username:
 
150
  return (
151
  "Please login with your Hugging Face account to check certification status",
152
  None,
 
185
 
186
 
187
  with gr.Blocks() as demo:
188
+ gr.Markdown(
189
+ """
190
  # Get your Certificate of Fundamentals of Agents 🎓
191
  The certification process is completely free.
192
 
193
  To earn this certificate, you need to complete <a href="https://hf.co/learn/agents-course/unit1/introduction" alt="Agent Course Unit 1"/>Unit 1 of the Agents Course</a> and **pass 80% of the final quiz**.
194
 
195
  Once you receive your certificate, don’t hesitate to share it on X (and tag @huggingface) as well as on LinkedIn so that we can congratulate you.
196
+ """
197
+ )
198
 
199
  # Add login button
200
  gr.LoginButton().activate()
 
212
  )
213
 
214
 
 
215
  if __name__ == "__main__":
216
  demo.launch(debug=True)
pyproject.toml CHANGED
@@ -7,6 +7,7 @@ requires-python = ">=3.11"
7
  dependencies = [
8
  "datasets>=3.2.0",
9
  "gradio[oauth]==5.15.0",
 
10
  "pandas>=2.2.3",
11
  "pillow>=11.1.0",
12
  ]
 
7
  dependencies = [
8
  "datasets>=3.2.0",
9
  "gradio[oauth]==5.15.0",
10
+ "huggingface-hub>=0.28.1",
11
  "pandas>=2.2.3",
12
  "pillow>=11.1.0",
13
  ]