Spaces:
Running
Running
one product in different shapes or sizes - each size or shape with it's own image
Browse files
app.py
CHANGED
@@ -465,6 +465,7 @@ def extract_requested_products(request, product_names):
|
|
465 |
"Here are the available product names:\n"
|
466 |
f"{product_list}\n"
|
467 |
"Identify any products explicitly or implicitly mentioned in the user's request. "
|
|
|
468 |
"If no products match, respond with 'None'. Output the result as a Python list. "
|
469 |
"Your response should contain only the list or 'None'."
|
470 |
)
|
@@ -475,12 +476,14 @@ def extract_requested_products(request, product_names):
|
|
475 |
{"role": "system", "content": prompt},
|
476 |
{"role": "user", "content": request},
|
477 |
],
|
|
|
478 |
)
|
479 |
response_text = response.choices[0].message.content
|
480 |
return eval(response_text)
|
481 |
|
482 |
|
483 |
def render_html_page(chat_text, images_to_use):
|
|
|
484 |
if images_to_use is None:
|
485 |
return "<html><body><h3>Requested product is not available.</h3></body></html>"
|
486 |
|
@@ -583,7 +586,7 @@ iface = gr.Interface(
|
|
583 |
|
584 |
|
585 |
def auth_function(username, password):
|
586 |
-
valid_users = {"admin": "demo4anthony1", "
|
587 |
return username in valid_users and valid_users[username] == password
|
588 |
|
589 |
|
|
|
465 |
"Here are the available product names:\n"
|
466 |
f"{product_list}\n"
|
467 |
"Identify any products explicitly or implicitly mentioned in the user's request. "
|
468 |
+
"If a product is mentioned in different sizes, consider each size as a separate product, and include duplicates in the list accordingly. "
|
469 |
"If no products match, respond with 'None'. Output the result as a Python list. "
|
470 |
"Your response should contain only the list or 'None'."
|
471 |
)
|
|
|
476 |
{"role": "system", "content": prompt},
|
477 |
{"role": "user", "content": request},
|
478 |
],
|
479 |
+
temperature=0.1,
|
480 |
)
|
481 |
response_text = response.choices[0].message.content
|
482 |
return eval(response_text)
|
483 |
|
484 |
|
485 |
def render_html_page(chat_text, images_to_use):
|
486 |
+
print(images_to_use)
|
487 |
if images_to_use is None:
|
488 |
return "<html><body><h3>Requested product is not available.</h3></body></html>"
|
489 |
|
|
|
586 |
|
587 |
|
588 |
def auth_function(username, password):
|
589 |
+
valid_users = {"admin": "demo4anthony1", "123": "123"}
|
590 |
return username in valid_users and valid_users[username] == password
|
591 |
|
592 |
|