Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -300,10 +300,9 @@ def create_pdf(images, description, email, company):
|
|
300 |
|
301 |
c.save()
|
302 |
|
303 |
-
absolute_path = os.path.abspath(filename)
|
304 |
|
305 |
-
|
306 |
-
return filename
|
307 |
|
308 |
|
309 |
# Function to generate image description using Claude 3 Sonnet
|
@@ -378,8 +377,8 @@ def generate_qr_code(filename):
|
|
378 |
qr = qrcode.QRCode(
|
379 |
version=None,
|
380 |
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
381 |
-
box_size=
|
382 |
-
border=
|
383 |
)
|
384 |
qr.add_data("https://mongodb-groupDemo.hf.space?file='" + filename + "'")
|
385 |
qr.make(fit=True)
|
@@ -396,7 +395,8 @@ def generate_qr_code(filename):
|
|
396 |
|
397 |
def on_change_make_qr(input):
|
398 |
|
399 |
-
|
|
|
400 |
|
401 |
|
402 |
with gr.Blocks() as demo:
|
@@ -440,9 +440,9 @@ with gr.Blocks() as demo:
|
|
440 |
record_button.click(
|
441 |
fn=record_participant,
|
442 |
inputs=[email_input, company_input, output_description, output_gallery],
|
443 |
-
outputs=[download_file
|
444 |
)
|
445 |
-
download_file.change(on_change_make_qr, inputs=download_file)
|
446 |
|
447 |
with gr.Tab("Code"):
|
448 |
gr.Code(label="Code", language="python", value=fetch_url_data('https://huggingface.co/spaces/MongoDB/aws-bedrock-celeb-matcher/raw/main/app.py'))
|
|
|
300 |
|
301 |
c.save()
|
302 |
|
|
|
303 |
|
304 |
+
|
305 |
+
return filename
|
306 |
|
307 |
|
308 |
# Function to generate image description using Claude 3 Sonnet
|
|
|
377 |
qr = qrcode.QRCode(
|
378 |
version=None,
|
379 |
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
380 |
+
box_size=4,
|
381 |
+
border=2,
|
382 |
)
|
383 |
qr.add_data("https://mongodb-groupDemo.hf.space?file='" + filename + "'")
|
384 |
qr.make(fit=True)
|
|
|
395 |
|
396 |
def on_change_make_qr(input):
|
397 |
|
398 |
+
qr_code_result = generate_qr_code("https://mongodb-groupeddemo.hf.space/file=" + input)
|
399 |
+
return qr_code_result
|
400 |
|
401 |
|
402 |
with gr.Blocks() as demo:
|
|
|
440 |
record_button.click(
|
441 |
fn=record_participant,
|
442 |
inputs=[email_input, company_input, output_description, output_gallery],
|
443 |
+
outputs=[download_file]
|
444 |
)
|
445 |
+
download_file.change(on_change_make_qr, inputs=download_file outputs=gr.Image(type="numpy", label="Generated QR Code"))
|
446 |
|
447 |
with gr.Tab("Code"):
|
448 |
gr.Code(label="Code", language="python", value=fetch_url_data('https://huggingface.co/spaces/MongoDB/aws-bedrock-celeb-matcher/raw/main/app.py'))
|