Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3050,7 +3050,83 @@ with gr.Blocks() as demo:
|
|
3050 |
]
|
3051 |
).then(
|
3052 |
fn=generate_standard_prompt, # После очистки вызываем функцию для обновления промпта
|
3053 |
-
inputs=[description_input, advantages_input, key_message_input, approach_input] + selections,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3054 |
outputs=prompt_display # Мгновенно обновляем поле неперсонализированного промпта
|
3055 |
).then(
|
3056 |
fn=update_best_example_prompt,
|
@@ -3200,7 +3276,7 @@ with gr.Blocks() as demo:
|
|
3200 |
]
|
3201 |
).then(
|
3202 |
fn=generate_standard_prompt, # После очистки вызываем функцию для обновления промпта
|
3203 |
-
inputs=[description_input, advantages_input, key_message_input, approach_input] + selections,
|
3204 |
outputs=prompt_display # Мгновенно обновляем поле неперсонализированного промпта
|
3205 |
)
|
3206 |
|
@@ -3273,11 +3349,11 @@ with gr.Blocks() as demo:
|
|
3273 |
]
|
3274 |
).then(
|
3275 |
fn=generate_standard_prompt, # После очистки вызываем функцию для обновления промпта
|
3276 |
-
inputs=[description_input, advantages_input, key_message_input, approach_input] + selections,
|
3277 |
outputs=prompt_display # Мгновенно обновляем поле неперсонализированного промпта
|
3278 |
).then(
|
3279 |
fn=generate_personalization_prompt, # Вызываем генерацию персонализированного промпта после изменения
|
3280 |
-
inputs=[key_message_input, approach_input] + selections, # Передаем все нужные параметры
|
3281 |
outputs=personalization_prompt # Обновляем поле с персонализированным промптом
|
3282 |
)
|
3283 |
|
@@ -3342,7 +3418,7 @@ with gr.Blocks() as demo:
|
|
3342 |
]
|
3343 |
).then(
|
3344 |
fn=generate_personalization_prompt, # Вызываем генерацию персонализированного промпта после изменения
|
3345 |
-
inputs=[key_message_input, approach_input] + selections, # Передаем все нужные параметры
|
3346 |
outputs=personalization_prompt # Обновляем поле с персонализированным промптом
|
3347 |
).then(
|
3348 |
fn=update_best_example_prompt,
|
@@ -3412,7 +3488,7 @@ with gr.Blocks() as demo:
|
|
3412 |
|
3413 |
submit_btn.click(
|
3414 |
generate_messages,
|
3415 |
-
inputs=[description_input, advantages_input, key_message_input, approach_input] + selections,
|
3416 |
outputs=[
|
3417 |
prompt_display,
|
3418 |
output_text_gigachat_pro,
|
@@ -3481,6 +3557,7 @@ with gr.Blocks() as demo:
|
|
3481 |
output_text_gpt4o,
|
3482 |
output_text_meta_llama_405b,
|
3483 |
description_input,
|
|
|
3484 |
advantages_input,
|
3485 |
key_message_input,
|
3486 |
approach_input,
|
|
|
3050 |
]
|
3051 |
).then(
|
3052 |
fn=generate_standard_prompt, # После очистки вызываем функцию для обновления промпта
|
3053 |
+
inputs=[description_input, product_name, advantages_input, key_message_input, approach_input] + selections,
|
3054 |
+
outputs=prompt_display # Мгновенно обновляем поле неперсонализированного промпта
|
3055 |
+
).then(
|
3056 |
+
fn=update_best_example_prompt,
|
3057 |
+
inputs=[description_input] + selections,
|
3058 |
+
outputs=best_example_prompt
|
3059 |
+
)
|
3060 |
+
|
3061 |
+
product_name.change(
|
3062 |
+
fn=clear_outputs, # Сначала вызываем функцию очистки полей
|
3063 |
+
inputs=[
|
3064 |
+
output_text_gigachat_pro,
|
3065 |
+
output_text_gigachat_lite,
|
3066 |
+
output_text_gigachat_plus,
|
3067 |
+
output_text_gpt4o,
|
3068 |
+
output_text_meta_llama_405b,
|
3069 |
+
personalized_output_text_gigachat_pro,
|
3070 |
+
personalized_output_text_gigachat_lite,
|
3071 |
+
personalized_output_text_gigachat_plus,
|
3072 |
+
personalized_output_text_gpt4o,
|
3073 |
+
personalized_output_text_meta_llama_405b,
|
3074 |
+
adapted_output_text_gigachat_pro,
|
3075 |
+
adapted_output_text_gigachat_lite,
|
3076 |
+
adapted_output_text_gigachat_plus,
|
3077 |
+
adapted_output_text_gpt4o,
|
3078 |
+
adapted_output_text_meta_llama_405b,
|
3079 |
+
comment_gigachat_pro,
|
3080 |
+
corrected_gigachat_pro,
|
3081 |
+
comment_gigachat_lite,
|
3082 |
+
corrected_gigachat_lite,
|
3083 |
+
comment_gigachat_plus,
|
3084 |
+
corrected_gigachat_plus,
|
3085 |
+
comment_gpt4o,
|
3086 |
+
corrected_gpt4o,
|
3087 |
+
comment_meta_llama_405b,
|
3088 |
+
corrected_meta_llama_405b,
|
3089 |
+
validation_display_1,
|
3090 |
+
validation_display_2,
|
3091 |
+
validation_display_3,
|
3092 |
+
validation_display_4,
|
3093 |
+
validation_display_5
|
3094 |
+
],
|
3095 |
+
outputs=[
|
3096 |
+
output_text_gigachat_pro,
|
3097 |
+
output_text_gigachat_lite,
|
3098 |
+
output_text_gigachat_plus,
|
3099 |
+
output_text_gpt4o,
|
3100 |
+
output_text_meta_llama_405b,
|
3101 |
+
personalized_output_text_gigachat_pro,
|
3102 |
+
personalized_output_text_gigachat_lite,
|
3103 |
+
personalized_output_text_gigachat_plus,
|
3104 |
+
personalized_output_text_gpt4o,
|
3105 |
+
personalized_output_text_meta_llama_405b,
|
3106 |
+
adapted_output_text_gigachat_pro,
|
3107 |
+
adapted_output_text_gigachat_lite,
|
3108 |
+
adapted_output_text_gigachat_plus,
|
3109 |
+
adapted_output_text_gpt4o,
|
3110 |
+
adapted_output_text_meta_llama_405b,
|
3111 |
+
comment_gigachat_pro,
|
3112 |
+
corrected_gigachat_pro,
|
3113 |
+
comment_gigachat_lite,
|
3114 |
+
corrected_gigachat_lite,
|
3115 |
+
comment_gigachat_plus,
|
3116 |
+
corrected_gigachat_plus,
|
3117 |
+
comment_gpt4o,
|
3118 |
+
corrected_gpt4o,
|
3119 |
+
comment_meta_llama_405b,
|
3120 |
+
corrected_meta_llama_405b,
|
3121 |
+
validation_display_1,
|
3122 |
+
validation_display_2,
|
3123 |
+
validation_display_3,
|
3124 |
+
validation_display_4,
|
3125 |
+
validation_display_5
|
3126 |
+
]
|
3127 |
+
).then(
|
3128 |
+
fn=generate_standard_prompt, # После очистки вызываем функцию для обновления промпта
|
3129 |
+
inputs=[description_input, product_name, advantages_input, key_message_input, approach_input] + selections,
|
3130 |
outputs=prompt_display # Мгновенно обновляем поле неперсонализированного промпта
|
3131 |
).then(
|
3132 |
fn=update_best_example_prompt,
|
|
|
3276 |
]
|
3277 |
).then(
|
3278 |
fn=generate_standard_prompt, # После очистки вызываем функцию для обновления промпта
|
3279 |
+
inputs=[description_input, product_name, advantages_input, key_message_input, approach_input] + selections,
|
3280 |
outputs=prompt_display # Мгновенно обновляем поле неперсонализированного промпта
|
3281 |
)
|
3282 |
|
|
|
3349 |
]
|
3350 |
).then(
|
3351 |
fn=generate_standard_prompt, # После очистки вызываем функцию для обновления промпта
|
3352 |
+
inputs=[description_input, product_name, advantages_input, key_message_input, approach_input] + selections,
|
3353 |
outputs=prompt_display # Мгновенно обновляем поле неперсонализированного промпта
|
3354 |
).then(
|
3355 |
fn=generate_personalization_prompt, # Вызываем генерацию персонализированного промпта после изменения
|
3356 |
+
inputs=[key_message_input, product_name, approach_input] + selections, # Передаем все нужные параметры
|
3357 |
outputs=personalization_prompt # Обновляем поле с персонализированным промптом
|
3358 |
)
|
3359 |
|
|
|
3418 |
]
|
3419 |
).then(
|
3420 |
fn=generate_personalization_prompt, # Вызываем генерацию персонализированного промпта после изменения
|
3421 |
+
inputs=[key_message_input, product_name, approach_input] + selections, # Передаем все нужные параметры
|
3422 |
outputs=personalization_prompt # Обновляем поле с персонализированным промптом
|
3423 |
).then(
|
3424 |
fn=update_best_example_prompt,
|
|
|
3488 |
|
3489 |
submit_btn.click(
|
3490 |
generate_messages,
|
3491 |
+
inputs=[description_input, product_name, advantages_input, key_message_input, approach_input] + selections,
|
3492 |
outputs=[
|
3493 |
prompt_display,
|
3494 |
output_text_gigachat_pro,
|
|
|
3557 |
output_text_gpt4o,
|
3558 |
output_text_meta_llama_405b,
|
3559 |
description_input,
|
3560 |
+
product_name,
|
3561 |
advantages_input,
|
3562 |
key_message_input,
|
3563 |
approach_input,
|