ThomasSimonini HF staff commited on
Commit
e6f3d40
·
1 Parent(s): bf79046

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -281,10 +281,10 @@ def verify_certification(df, hf_username, first_name, last_name):
281
 
282
  if pass_percentage == 100:
283
  # Generate a certificate of excellence
284
- generate_certificate("./certificate_models/certificate-excellence.png", first_name, last_name)
285
 
286
  # Add this user to our database
287
- add_certified_user(hf_username, first_name, last_name, pass_percentage)
288
 
289
  # Output everything in gradio
290
 
@@ -358,7 +358,8 @@ with gr.Blocks() as demo:
358
  last_name = gr.Textbox(placeholder="Doe", label="Your Last Name")
359
  #email = gr.Textbox(placeholder="[email protected]", label="Your Email (to receive your certificate)")
360
  check_progress_button = gr.Button(value="Check my progress")
361
- output = gr.components.Dataframe(value= certification(hf_username), headers=["Pass?", "Unit", "Environment", "Baseline", "Your best result", "Your best model id"], datatype=["markdown", "markdown", "markdown", "number", "number", "markdown", "bool"])
362
- check_progress_button.click(fn=certification, inputs=hf_username, outputs=output)
 
363
 
364
  demo.launch(debug=True)
 
281
 
282
  if pass_percentage == 100:
283
  # Generate a certificate of excellence
284
+ generate_certificate("./certificate_models/certificate-excellence.png", str(first_name), str(last_name))
285
 
286
  # Add this user to our database
287
+ add_certified_user(hf_username, str(first_name), str(last_name), pass_percentage)
288
 
289
  # Output everything in gradio
290
 
 
358
  last_name = gr.Textbox(placeholder="Doe", label="Your Last Name")
359
  #email = gr.Textbox(placeholder="[email protected]", label="Your Email (to receive your certificate)")
360
  check_progress_button = gr.Button(value="Check my progress")
361
+ output1 = gr.components.Dataframe(value= certification(hf_username), headers=["Pass?", "Unit", "Environment", "Baseline", "Your best result", "Your best model id"], datatype=["markdown", "markdown", "markdown", "number", "number", "markdown", "bool"])
362
+ #output2 = gr.components.Image(type="pil")
363
+ check_progress_button.click(fn=certification, inputs=hf_username, outputs=[output1, output2])
364
 
365
  demo.launch(debug=True)