Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -300,8 +300,10 @@ def create_pdf(images, description, email, company):
|
|
| 300 |
|
| 301 |
c.save()
|
| 302 |
|
| 303 |
-
|
| 304 |
-
|
|
|
|
|
|
|
| 305 |
|
| 306 |
|
| 307 |
# Function to generate image description using Claude 3 Sonnet
|
|
@@ -371,9 +373,6 @@ def start_image_search(image, text):
|
|
| 371 |
return images, description
|
| 372 |
|
| 373 |
def generate_qr_code(filename):
|
| 374 |
-
# Read the content of the file
|
| 375 |
-
with open(filename, 'rb') as file:
|
| 376 |
-
file_content = file.read()
|
| 377 |
|
| 378 |
# Generate QR code
|
| 379 |
qr = qrcode.QRCode(
|
|
@@ -382,7 +381,7 @@ def generate_qr_code(filename):
|
|
| 382 |
box_size=10,
|
| 383 |
border=4,
|
| 384 |
)
|
| 385 |
-
qr.add_data(
|
| 386 |
qr.make(fit=True)
|
| 387 |
|
| 388 |
img_qr = qr.make_image(fill_color="black", back_color="white")
|
|
|
|
| 300 |
|
| 301 |
c.save()
|
| 302 |
|
| 303 |
+
absolute_path = os.path.abspath(filename)
|
| 304 |
+
|
| 305 |
+
qr_code_result = generate_qr_code(absolute_path)
|
| 306 |
+
return qr_code_result
|
| 307 |
|
| 308 |
|
| 309 |
# Function to generate image description using Claude 3 Sonnet
|
|
|
|
| 373 |
return images, description
|
| 374 |
|
| 375 |
def generate_qr_code(filename):
|
|
|
|
|
|
|
|
|
|
| 376 |
|
| 377 |
# Generate QR code
|
| 378 |
qr = qrcode.QRCode(
|
|
|
|
| 381 |
box_size=10,
|
| 382 |
border=4,
|
| 383 |
)
|
| 384 |
+
qr.add_data("https://mongodb-groupDemo.hf.space?file='" + filename + "'")
|
| 385 |
qr.make(fit=True)
|
| 386 |
|
| 387 |
img_qr = qr.make_image(fill_color="black", back_color="white")
|