Update app.py
Browse files
app.py
CHANGED
|
@@ -225,11 +225,14 @@ with gr.Blocks(css=css) as demo:
|
|
| 225 |
outputs=[custom_instruction],
|
| 226 |
)
|
| 227 |
|
| 228 |
-
# Modified function to handle test limit with improved messaging and cookie-based user sessions
|
| 229 |
def handle_submit(image, description_type, custom_instruction, request: gr.Request):
|
| 230 |
user_id, cookie = get_or_create_user_id(request)
|
| 231 |
check_and_reset_user_counter(user_id) # Check and reset counter if it's a new day
|
| 232 |
test_counter = increment_user_counter(user_id)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
if test_counter <= 4:
|
| 234 |
result = generate_product_description(image, description_type, custom_instruction)
|
| 235 |
remaining_tests = 4 - test_counter
|
|
@@ -242,14 +245,14 @@ with gr.Blocks(css=css) as demo:
|
|
| 242 |
cookie,
|
| 243 |
)
|
| 244 |
else:
|
| 245 |
-
redirect_text = """
|
| 246 |
Thank you for trying our product description generation tool!
|
| 247 |
|
| 248 |
You've used all 4 of your free tests for today. We hope you found them helpful and insightful.
|
| 249 |
|
| 250 |
To unlock unlimited access and discover how our AI-powered solution can revolutionize your content creation process:
|
| 251 |
|
| 252 |
-
[Book a Personalized Demo with Our Experts](
|
| 253 |
|
| 254 |
During the demo, you'll get:
|
| 255 |
• A tailored walkthrough of our full suite of features
|
|
@@ -268,14 +271,14 @@ with gr.Blocks(css=css) as demo:
|
|
| 268 |
cookie,
|
| 269 |
)
|
| 270 |
else:
|
| 271 |
-
redirect_text = """
|
| 272 |
Thank you for your interest in our product description generation tool!
|
| 273 |
|
| 274 |
You've already used your 4 free tests for today. We hope they've given you a glimpse of how our AI can enhance your content creation.
|
| 275 |
|
| 276 |
Ready to explore the full potential of our solution?
|
| 277 |
|
| 278 |
-
[Book a Personalized Demo with Our Experts](
|
| 279 |
|
| 280 |
In this demo, you'll discover:
|
| 281 |
• How our AI can be customized for your specific needs
|
|
|
|
| 225 |
outputs=[custom_instruction],
|
| 226 |
)
|
| 227 |
|
|
|
|
| 228 |
def handle_submit(image, description_type, custom_instruction, request: gr.Request):
|
| 229 |
user_id, cookie = get_or_create_user_id(request)
|
| 230 |
check_and_reset_user_counter(user_id) # Check and reset counter if it's a new day
|
| 231 |
test_counter = increment_user_counter(user_id)
|
| 232 |
+
|
| 233 |
+
# UTM-tagged demo booking link
|
| 234 |
+
demo_link = "https://wordlift.io/book-a-demo/?utm_source=free-app&utm_medium=app&utm_campaign=product-description-generator"
|
| 235 |
+
|
| 236 |
if test_counter <= 4:
|
| 237 |
result = generate_product_description(image, description_type, custom_instruction)
|
| 238 |
remaining_tests = 4 - test_counter
|
|
|
|
| 245 |
cookie,
|
| 246 |
)
|
| 247 |
else:
|
| 248 |
+
redirect_text = f"""
|
| 249 |
Thank you for trying our product description generation tool!
|
| 250 |
|
| 251 |
You've used all 4 of your free tests for today. We hope you found them helpful and insightful.
|
| 252 |
|
| 253 |
To unlock unlimited access and discover how our AI-powered solution can revolutionize your content creation process:
|
| 254 |
|
| 255 |
+
[Book a Personalized Demo with Our Experts]({demo_link})
|
| 256 |
|
| 257 |
During the demo, you'll get:
|
| 258 |
• A tailored walkthrough of our full suite of features
|
|
|
|
| 271 |
cookie,
|
| 272 |
)
|
| 273 |
else:
|
| 274 |
+
redirect_text = f"""
|
| 275 |
Thank you for your interest in our product description generation tool!
|
| 276 |
|
| 277 |
You've already used your 4 free tests for today. We hope they've given you a glimpse of how our AI can enhance your content creation.
|
| 278 |
|
| 279 |
Ready to explore the full potential of our solution?
|
| 280 |
|
| 281 |
+
[Book a Personalized Demo with Our Experts]({demo_link})
|
| 282 |
|
| 283 |
In this demo, you'll discover:
|
| 284 |
• How our AI can be customized for your specific needs
|