Spaces:
Sleeping
Sleeping
fruitpicker01
commited on
Commit
•
dea71ee
1
Parent(s):
6bd154c
Update app.py
Browse files
app.py
CHANGED
@@ -668,6 +668,7 @@ def clean_prompt_for_display(prompt, prefixes, suffixes):
|
|
668 |
# Функция для постепенной генерации всех сообщений через yield
|
669 |
def generate_all_messages(desc, benefits, key_message, gender, generation, psychotype, business_stage, industry, opf, product_name):
|
670 |
standard_prompt = generate_standard_prompt(desc, benefits, key_message)
|
|
|
671 |
approach_mapping = {
|
672 |
"Указание на пользу": (
|
673 |
"Начни сообщение с указания на пользу продукта. Используй глагол в побудительном наклонении.",
|
@@ -706,7 +707,7 @@ def generate_all_messages(desc, benefits, key_message, gender, generation, psych
|
|
706 |
approach_list = list(set(approach_list)) # Убираем дубликаты
|
707 |
selected_approaches_text_content = ', '.join(approach_list)
|
708 |
|
709 |
-
yield selected_approaches_text_content,
|
710 |
|
711 |
non_personalized_messages = ''
|
712 |
personalized_messages = ''
|
@@ -745,7 +746,7 @@ def generate_all_messages(desc, benefits, key_message, gender, generation, psych
|
|
745 |
else:
|
746 |
non_personalized_messages = non_personalized_display
|
747 |
yield (
|
748 |
-
selected_approaches_text_content,
|
749 |
non_personalized_messages, personalized_messages
|
750 |
)
|
751 |
full_personalized_prompt = f"{personalization_prompt}\n\nТекст для адаптации: {non_personalized_message}"
|
@@ -757,7 +758,7 @@ def generate_all_messages(desc, benefits, key_message, gender, generation, psych
|
|
757 |
else:
|
758 |
personalized_messages = personalized_display
|
759 |
yield (
|
760 |
-
selected_approaches_text_content,
|
761 |
non_personalized_messages, personalized_messages
|
762 |
)
|
763 |
time.sleep(1)
|
|
|
668 |
# Функция для постепенной генерации всех сообщений через yield
|
669 |
def generate_all_messages(desc, benefits, key_message, gender, generation, psychotype, business_stage, industry, opf, product_name):
|
670 |
standard_prompt = generate_standard_prompt(desc, benefits, key_message)
|
671 |
+
standard_prompt_for_display = f"Не изменяй название продукта: {product_name}.\n{standard_prompt}\nУбедись, что в готовом тексте без изменений, синонимов и перестановок слов используется наименование продукта: {product_name}.\n"
|
672 |
approach_mapping = {
|
673 |
"Указание на пользу": (
|
674 |
"Начни сообщение с указания на пользу продукта. Используй глагол в побудительном наклонении.",
|
|
|
707 |
approach_list = list(set(approach_list)) # Убираем дубликаты
|
708 |
selected_approaches_text_content = ', '.join(approach_list)
|
709 |
|
710 |
+
yield selected_approaches_text_content, standard_prompt_for_display, None, None, None
|
711 |
|
712 |
non_personalized_messages = ''
|
713 |
personalized_messages = ''
|
|
|
746 |
else:
|
747 |
non_personalized_messages = non_personalized_display
|
748 |
yield (
|
749 |
+
selected_approaches_text_content, standard_prompt_for_display, display_personalization_prompt,
|
750 |
non_personalized_messages, personalized_messages
|
751 |
)
|
752 |
full_personalized_prompt = f"{personalization_prompt}\n\nТекст для адаптации: {non_personalized_message}"
|
|
|
758 |
else:
|
759 |
personalized_messages = personalized_display
|
760 |
yield (
|
761 |
+
selected_approaches_text_content, standard_prompt_for_display, display_personalization_prompt,
|
762 |
non_personalized_messages, personalized_messages
|
763 |
)
|
764 |
time.sleep(1)
|