Pash1986 commited on
Commit
5e097bf
1 Parent(s): ec69dcf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
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
- qr_code_result = generate_qr_code(absolute_path)
306
- return filename,qr_code_result
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=10,
382
- border=4,
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
- print(input)
 
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,gr.Image(type="numpy", label="Generated QR Code")]
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'))