Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
burtenshaw
commited on
Commit
·
7a0686a
1
Parent(s):
dabc1e3
simplify download
Browse files
app.py
CHANGED
@@ -51,7 +51,7 @@ def generate_certificate(
|
|
51 |
pdf = im.convert("RGB")
|
52 |
pdf.save("certificate.pdf")
|
53 |
|
54 |
-
return im, "
|
55 |
|
56 |
|
57 |
def get_user_info(oauth_token):
|
@@ -190,7 +190,6 @@ def check_certification(token: gr.OAuthToken | None):
|
|
190 |
|
191 |
return (
|
192 |
gr.update(visible=True, value=result_message, label="Grade"),
|
193 |
-
gr.update(visible=result.passed, value=pdf_path, label="Download Certificate"),
|
194 |
gr.update(visible=result.passed, value=certificate_img, label="Certificate"),
|
195 |
)
|
196 |
|
@@ -217,11 +216,10 @@ def create_gradio_interface():
|
|
217 |
|
218 |
output_text = gr.Markdown(visible=False, sanitize_html=False)
|
219 |
output_img = gr.Image(type="pil", visible=False)
|
220 |
-
output_pdf = gr.File(visible=False)
|
221 |
|
222 |
check_progress_button.click(
|
223 |
fn=check_certification,
|
224 |
-
outputs=[output_text,
|
225 |
).then(
|
226 |
fn=join_finishers_org,
|
227 |
)
|
|
|
51 |
pdf = im.convert("RGB")
|
52 |
pdf.save("certificate.pdf")
|
53 |
|
54 |
+
return im, "certificate.pdf"
|
55 |
|
56 |
|
57 |
def get_user_info(oauth_token):
|
|
|
190 |
|
191 |
return (
|
192 |
gr.update(visible=True, value=result_message, label="Grade"),
|
|
|
193 |
gr.update(visible=result.passed, value=certificate_img, label="Certificate"),
|
194 |
)
|
195 |
|
|
|
216 |
|
217 |
output_text = gr.Markdown(visible=False, sanitize_html=False)
|
218 |
output_img = gr.Image(type="pil", visible=False)
|
|
|
219 |
|
220 |
check_progress_button.click(
|
221 |
fn=check_certification,
|
222 |
+
outputs=[output_text, output_img],
|
223 |
).then(
|
224 |
fn=join_finishers_org,
|
225 |
)
|