Spaces:
Sleeping
Sleeping
fruitpicker01
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -660,6 +660,7 @@ def clean_prompt_for_display(prompt, prefixes, suffixes):
|
|
660 |
|
661 |
# Функция для постепенной генерации всех сообщений через yield
|
662 |
def generate_all_messages(desc, benefits, key_message, gender, generation, psychotype, business_stage, industry, opf):
|
|
|
663 |
# Определение подходов
|
664 |
approach_mapping = {
|
665 |
"Указание на пользу": (
|
@@ -696,13 +697,11 @@ def generate_all_messages(desc, benefits, key_message, gender, generation, psych
|
|
696 |
for approaches in matching_rows['Подход']:
|
697 |
approach_names = [a.strip() for a in approaches.split(',')]
|
698 |
approach_set.update(approach_names)
|
699 |
-
selected_approaches_text_content =
|
700 |
|
701 |
# Генерация стандартного задания
|
702 |
-
standard_prompt = generate_standard_prompt(desc, benefits, key_message)
|
703 |
yield selected_approaches_text_content, standard_prompt, None, None, None
|
704 |
|
705 |
-
# Инициализация переменных для сообщений
|
706 |
non_personalized_messages = ''
|
707 |
personalized_messages = ''
|
708 |
flag = 1
|
@@ -1632,16 +1631,23 @@ with gr.Blocks() as demo:
|
|
1632 |
|
1633 |
# Вкладка 2: Промпты
|
1634 |
with gr.TabItem("Ассистент", id=1):
|
1635 |
-
|
1636 |
-
|
1637 |
-
|
1638 |
-
|
1639 |
-
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
|
1644 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1645 |
|
1646 |
# Вкладка 3: Сообщения
|
1647 |
with gr.TabItem("Сообщения", id=2):
|
|
|
660 |
|
661 |
# Функция для постепенной генерации всех сообщений через yield
|
662 |
def generate_all_messages(desc, benefits, key_message, gender, generation, psychotype, business_stage, industry, opf):
|
663 |
+
standard_prompt = generate_standard_prompt(desc, benefits, key_message)
|
664 |
# Определение подходов
|
665 |
approach_mapping = {
|
666 |
"Указание на пользу": (
|
|
|
697 |
for approaches in matching_rows['Подход']:
|
698 |
approach_names = [a.strip() for a in approaches.split(',')]
|
699 |
approach_set.update(approach_names)
|
700 |
+
selected_approaches_text_content = ', '.join(approach_set)
|
701 |
|
702 |
# Генерация стандартного задания
|
|
|
703 |
yield selected_approaches_text_content, standard_prompt, None, None, None
|
704 |
|
|
|
705 |
non_personalized_messages = ''
|
706 |
personalized_messages = ''
|
707 |
flag = 1
|
|
|
1631 |
|
1632 |
# Вкладка 2: Промпты
|
1633 |
with gr.TabItem("Ассистент", id=1):
|
1634 |
+
selected_approaches_text = gr.Textbox(
|
1635 |
+
label="Выбранные подходы согласно рекомендациям Нейролаборатории",
|
1636 |
+
interactive=False,
|
1637 |
+
lines=1
|
1638 |
+
)
|
1639 |
+
with gr.Row():
|
1640 |
+
with gr.Column():
|
1641 |
+
non_personalized_prompt = gr.Textbox(
|
1642 |
+
label="Задание для копирайтера",
|
1643 |
+
lines=23,
|
1644 |
+
interactive=False)
|
1645 |
+
with gr.Column():
|
1646 |
+
personalized_prompt = gr.Textbox(
|
1647 |
+
label="Задание для редактора",
|
1648 |
+
lines=23
|
1649 |
+
)
|
1650 |
+
|
1651 |
|
1652 |
# Вкладка 3: Сообщения
|
1653 |
with gr.TabItem("Сообщения", id=2):
|