Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -839,6 +839,14 @@ def reset_button_text():
|
|
839 |
time.sleep(2) # Задержка в 2 секунды
|
840 |
return gr.update(value="Сохранить в базу", visible=True)
|
841 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
842 |
|
843 |
# Создание интерфейса Gradio
|
844 |
with gr.Blocks() as demo:
|
@@ -1097,7 +1105,57 @@ with gr.Blocks() as demo:
|
|
1097 |
load_btn.click(
|
1098 |
fn=lambda: load_previous_user_request_from_github(),
|
1099 |
inputs=[],
|
1100 |
-
outputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1101 |
)
|
1102 |
|
1103 |
|
|
|
839 |
time.sleep(2) # Задержка в 2 секунды
|
840 |
return gr.update(value="Сохранить в базу", visible=True)
|
841 |
|
842 |
+
def clear_unnecessary_fields():
|
843 |
+
return (
|
844 |
+
"", "", "", "", "", "", "", "", "", "", # personalized outputs and prompts
|
845 |
+
"", "", "", "", "", "", "", "", "", "", # comment fields
|
846 |
+
"", "", "", "", "", "", "", "", "", "", # corrected message fields
|
847 |
+
"" # пустой комментарий в конце
|
848 |
+
)
|
849 |
+
|
850 |
|
851 |
# Создание интерфейса Gradio
|
852 |
with gr.Blocks() as demo:
|
|
|
1105 |
load_btn.click(
|
1106 |
fn=lambda: load_previous_user_request_from_github(),
|
1107 |
inputs=[],
|
1108 |
+
outputs=[
|
1109 |
+
description_input, # Описание предложения
|
1110 |
+
advantages_input, # Преимущества
|
1111 |
+
*selections, # Параметры персонализации (Пол, Поколение, и т.д.)
|
1112 |
+
]
|
1113 |
+
).then(
|
1114 |
+
fn=clear_unnecessary_fields,
|
1115 |
+
inputs=[],
|
1116 |
+
outputs=[
|
1117 |
+
prompt_display,
|
1118 |
+
output_text_gpt4o,
|
1119 |
+
output_text_gigachat_pro,
|
1120 |
+
output_text_gigachat_lite,
|
1121 |
+
output_text_gigachat_plus,
|
1122 |
+
output_text_meta_llama_405b,
|
1123 |
+
output_text_meta_llama_70b,
|
1124 |
+
output_text_meta_llama_8b,
|
1125 |
+
output_text_gemma_27b,
|
1126 |
+
output_text_gemma_9b,
|
1127 |
+
output_text_mistral,
|
1128 |
+
personalized_output_text_gpt4o,
|
1129 |
+
personalized_output_text_gigachat_pro,
|
1130 |
+
personalized_output_text_gigachat_lite,
|
1131 |
+
personalized_output_text_gigachat_plus,
|
1132 |
+
personalized_output_text_meta_llama_405b,
|
1133 |
+
personalized_output_text_meta_llama_70b,
|
1134 |
+
personalized_output_text_meta_llama_8b,
|
1135 |
+
personalized_output_text_gemma_27b,
|
1136 |
+
personalized_output_text_gemma_9b,
|
1137 |
+
personalized_output_text_mistral,
|
1138 |
+
comment_gpt4o,
|
1139 |
+
corrected_gpt4o,
|
1140 |
+
comment_gigachat_pro,
|
1141 |
+
corrected_gigachat_pro,
|
1142 |
+
comment_gigachat_lite,
|
1143 |
+
corrected_gigachat_lite,
|
1144 |
+
comment_gigachat_plus,
|
1145 |
+
corrected_gigachat_plus,
|
1146 |
+
comment_meta_llama_405b,
|
1147 |
+
corrected_meta_llama_405b,
|
1148 |
+
comment_meta_llama_70b,
|
1149 |
+
corrected_meta_llama_70b,
|
1150 |
+
comment_meta_llama_8b,
|
1151 |
+
corrected_meta_llama_8b,
|
1152 |
+
comment_gemma_27b,
|
1153 |
+
corrected_gemma_27b,
|
1154 |
+
comment_gemma_9b,
|
1155 |
+
corrected_gemma_9b,
|
1156 |
+
comment_mistral,
|
1157 |
+
corrected_mistral
|
1158 |
+
]
|
1159 |
)
|
1160 |
|
1161 |
|