fruitpicker01 commited on
Commit
77befc0
·
verified ·
1 Parent(s): 5900bf4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +42 -76
app.py CHANGED
@@ -76,7 +76,7 @@ def generate_standard_prompt(description, advantages, *selected_values):
76
  return prompt
77
 
78
  # Функции для генерации сообщений
79
- def generate_message_gpt4o(prompt, temperature=1):
80
  try:
81
  headers = {
82
  "Content-Type": "application/json",
@@ -85,16 +85,14 @@ def generate_message_gpt4o(prompt, temperature=1):
85
  data = {
86
  "model": "chatgpt-4o-latest",
87
  "messages": [{"role": "system", "content": prompt}],
88
- "max_tokens": 101,
89
- "temperature": temperature # Передача температуры
90
  }
91
  response = requests.post("https://api.openai.com/v1/chat/completions", json=data, headers=headers)
92
  response_data = response.json()
93
- return clean_message(response_data["choices"][0]["message"]["content"].strip()) + f" {temperature}"
94
  except Exception as e:
95
  return f"Ошибка при обращении к ChatGPT-4o-Latest: {e}"
96
 
97
-
98
  def clean_message(message):
99
  # Если сообщение не заканчивается на точку или восклицательный знак, обрезаем его до последней точки
100
  if not message.endswith(('.', '!', '?')):
@@ -104,72 +102,67 @@ def clean_message(message):
104
  return message
105
 
106
  # Обновленные функции генерации сообщений с учетом обрезки незаконченных предложений
107
- def generate_message_gigachat_pro(prompt, temperature=0.87):
108
  try:
109
  messages = [SystemMessage(content=prompt)]
110
- chat_pro = GigaChat(credentials=gc_key, model='GigaChat-Pro', max_tokens=68, temperature=temperature, verify_ssl_certs=False)
111
  res = chat_pro(messages)
112
  cleaned_message = clean_message(res.content.strip())
113
  return cleaned_message
114
  except Exception as e:
115
  return f"Ошибка при обращении к GigaChat-Pro: {e}"
116
 
117
- def generate_message_gigachat_lite(prompt, temperature=0.87):
118
  try:
119
  time.sleep(2)
120
  messages = [SystemMessage(content=prompt)]
121
- chat_lite = GigaChat(credentials=gc_key, model='GigaChat', max_tokens=68, temperature=temperature, verify_ssl_certs=False)
122
  res = chat_lite(messages)
123
  cleaned_message = clean_message(res.content.strip())
124
  return cleaned_message
125
  except Exception as e:
126
  return f"Ошибка при обращении к GigaChat-Lite: {e}"
127
 
128
- def generate_message_gigachat_plus(prompt, temperature=0.87):
129
  try:
130
  time.sleep(2)
131
  messages = [SystemMessage(content=prompt)]
132
- chat_plus = GigaChat(credentials=gc_key, model='GigaChat-Plus', max_tokens=68, temperature=temperature, verify_ssl_certs=False)
133
  res = chat_plus(messages)
134
  cleaned_message = clean_message(res.content.strip())
135
  return cleaned_message
136
  except Exception as e:
137
  return f"Ошибка при обращении к GigaChat-Plus: {e}"
138
 
139
- def generate_message_gpt4o_with_retry(prompt, gpt4o_temperature):
140
  for _ in range(10): # Максимум 10 попыток
141
- message = generate_message_gpt4o(prompt, gpt4o_temperature)
142
  if len(message) <= 250:
143
  return message
144
  return message # Возвращаем последнее сгенерированное сообщение, если все попытки не удались
145
 
146
- def generate_message_gigachat_pro_with_retry(prompt, gigachat_pro_temperature):
147
  for _ in range(10):
148
- message = generate_message_gigachat_pro(prompt, gigachat_pro_temperature)
149
  if len(message) <= 250:
150
  return message
151
  return message
152
 
153
- def generate_message_gigachat_lite_with_retry(prompt, gigachat_lite_temperature):
154
  for _ in range(10):
155
- message = generate_message_gigachat_lite(prompt, gigachat_lite_temperature)
156
  if len(message) <= 250:
157
  return message
158
  return message
159
 
160
- def generate_message_gigachat_plus_with_retry(prompt, gigachat_plus_temperature):
161
  for _ in range(10):
162
- message = generate_message_gigachat_plus(prompt, gigachat_plus_temperature)
163
  if len(message) <= 250:
164
  return message
165
  return message
166
 
167
-
168
- # Обновляем генерацию сообщений для отображения в интерфейсе
169
- def generate_messages(description, advantages, *selected_values, gpt4o_temperature, gigachat_pro_temperature, gigachat_lite_temperature, gigachat_plus_temperature):
170
 
171
- # Далее используйте эти переменные для генерации сообщений
172
- standard_prompt = generate_standard_prompt(description, advantages, *selected_values, gpt4o_temperature, gigachat_pro_temperature, gigachat_lite_temperature, gigachat_plus_temperature)
 
173
 
174
  results = {
175
  "prompt": standard_prompt,
@@ -181,26 +174,26 @@ def generate_messages(description, advantages, *selected_values, gpt4o_temperatu
181
 
182
  yield results["prompt"], "", "", "", "", "Генерация стандартного промпта завершена"
183
 
184
- results["gpt4o"] = generate_message_gpt4o_with_retry(standard_prompt, gpt4o_temperature)
185
  gpt4o_length = len(results["gpt4o"])
186
  gpt4o_display = f"{results['gpt4o']}\n\n------\nКоличество знаков: {gpt4o_length}"
187
  yield results["prompt"], gpt4o_display, "", "", "", "Сообщение GPT-4o сгенерировано"
188
 
189
- results["gigachat_pro"] = generate_message_gigachat_pro_with_retry(standard_prompt, gigachat_pro_temperature)
190
  gigachat_pro_length = len(results["gigachat_pro"])
191
  gigachat_pro_display = f"{results['gigachat_pro']}\n\n------\nКоличество знаков: {gigachat_pro_length}"
192
  yield results["prompt"], gpt4o_display, gigachat_pro_display, "", "", "Сообщение GigaChat-Pro сгенерировано"
193
 
194
  time.sleep(2)
195
 
196
- results["gigachat_lite"] = generate_message_gigachat_lite_with_retry(standard_prompt, gigachat_lite_temperature)
197
  gigachat_lite_length = len(results["gigachat_lite"])
198
  gigachat_lite_display = f"{results['gigachat_lite']}\n\n------\nКоличество знаков: {gigachat_lite_length}"
199
  yield results["prompt"], gpt4o_display, gigachat_pro_display, gigachat_lite_display, "", "Сообщение GigaChat-Lite сгенерировано"
200
 
201
  time.sleep(2)
202
 
203
- results["gigachat_plus"] = generate_message_gigachat_plus_with_retry(standard_prompt, gigachat_plus_temperature)
204
  gigachat_plus_length = len(results["gigachat_plus"])
205
  gigachat_plus_display = f"{results['gigachat_plus']}\n\n------\nКоличество знаков: {gigachat_plus_length}"
206
  yield results["prompt"], gpt4o_display, gigachat_pro_display, gigachat_lite_display, gigachat_plus_display, "Все сообщения сгенерированы"
@@ -353,11 +346,10 @@ def check_errors_with_yield(*personalized_messages):
353
  yield error_check_prompt, error_message_gpt4o, error_message_gigachat_pro, error_message_gigachat_lite, error_message_gigachat_plus, "Все результаты проверки сгенерированы"
354
 
355
 
356
- def save_to_github(personalized_message, model_name, comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form, temperature):
357
  # Собираем все данные в один словарь
358
  data_to_save = {
359
  "Модель": model_name,
360
- "Температура": temperature, # Добавляем температуру
361
  "Персонализированное сообщение": personalized_message,
362
  "Комментарий": comment,
363
  "Откорректированное сообщение": corrected_message,
@@ -392,23 +384,11 @@ def save_to_github(personalized_message, model_name, comment, corrected_message,
392
  # Отправка POST-запроса на GitHub API для создания файла в репозитории
393
  response = requests.put(url, headers=headers, data=json.dumps(data))
394
 
395
- if response.status_code == 201:
396
- print("Файл успешно загружен на GitHub.")
397
- else:
398
- print(f"Ошибка при загрузке файла на GitHub: {response.status_code}")
399
- print(f"Ответ сервера: {response.json()}")
400
-
401
 
402
  # Создание интерфейса Gradio
403
  with gr.Blocks() as demo:
404
  gr.Markdown("# Генерация SMS-сообщений по заданным ��ризнакам")
405
 
406
- # Добавление элементов управления температурой для каждой модели
407
- gpt4o_temperature = gr.Slider(label="GPT-4o: temperature", minimum=0, maximum=2, step=0.01, value=1).value
408
- gigachat_pro_temperature = gr.Slider(label="GigaChat-Pro: temperature", minimum=0, maximum=2, step=0.01, value=0.87).value
409
- gigachat_lite_temperature = gr.Slider(label="GigaChat-Lite: temperature", minimum=0, maximum=2, step=0.01, value=0.87).value
410
- gigachat_plus_temperature = gr.Slider(label="GigaChat-Plus: temperature", minimum=0, maximum=2, step=0.01, value=0.87).value
411
-
412
  with gr.Row():
413
  with gr.Column(scale=1):
414
  description_input = gr.Textbox(
@@ -448,20 +428,11 @@ with gr.Blocks() as demo:
448
  output_text_gigachat_lite = gr.Textbox(label="Неперсонализированное сообщение GigaChat-Lite", lines=3, interactive=False)
449
  output_text_gigachat_plus = gr.Textbox(label="Неперсонализированное сообщение GigaChat-Lite+", lines=3, interactive=False)
450
 
451
- submit_btn.click(
452
- generate_messages,
453
- inputs=[
454
- description_input,
455
- advantages_input,
456
- *selections,
457
- gpt4o_temperature,
458
- gigachat_pro_temperature,
459
- gigachat_lite_temperature,
460
- gigachat_plus_temperature
461
- ],
462
- outputs=[prompt_display, output_text_gpt4o, output_text_gigachat_pro, output_text_gigachat_lite, output_text_gigachat_plus]
463
- )
464
-
465
 
466
  with gr.Row():
467
  personalize_btn = gr.Button("2. Выполнить персонализацию (нажимать только после кнопки 1)", elem_id="personalize_button")
@@ -504,8 +475,8 @@ with gr.Blocks() as demo:
504
 
505
  # Привязка кнопок к функциям сохранения
506
  save_gpt4o_btn.click(
507
- fn=lambda personalized_message, comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form, temperature:
508
- save_to_github(personalized_message, "GPT-4o", comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form, temperature),
509
  inputs=[
510
  personalized_output_text_gpt4o,
511
  comment_gpt4o,
@@ -519,15 +490,14 @@ with gr.Blocks() as demo:
519
  selections[2], # Психотип
520
  selections[3], # Стадия бизнеса
521
  selections[4], # Отрасль
522
- selections[5], # ОПФ
523
- gpt4o_temperature # Передача температуры
524
  ],
525
  outputs=None
526
  )
527
-
528
  save_gigachat_pro_btn.click(
529
- fn=lambda personalized_message, comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form, temperature:
530
- save_to_github(personalized_message, "GigaChat-Pro", comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form, temperature),
531
  inputs=[
532
  personalized_output_text_gigachat_pro,
533
  comment_gigachat_pro,
@@ -541,15 +511,14 @@ with gr.Blocks() as demo:
541
  selections[2], # Психотип
542
  selections[3], # Стадия бизнеса
543
  selections[4], # Отрасль
544
- selections[5], # ОПФ
545
- gigachat_pro_temperature # Передача температуры
546
  ],
547
  outputs=None
548
  )
549
-
550
  save_gigachat_lite_btn.click(
551
- fn=lambda personalized_message, comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form, temperature:
552
- save_to_github(personalized_message, "GigaChat-Lite", comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form, temperature),
553
  inputs=[
554
  personalized_output_text_gigachat_lite,
555
  comment_gigachat_lite,
@@ -563,15 +532,14 @@ with gr.Blocks() as demo:
563
  selections[2], # Психотип
564
  selections[3], # Стадия бизнеса
565
  selections[4], # Отрасль
566
- selections[5], # ОПФ
567
- gigachat_lite_temperature # Передача температуры
568
  ],
569
  outputs=None
570
  )
571
-
572
  save_gigachat_plus_btn.click(
573
- fn=lambda personalized_message, comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form, temperature:
574
- save_to_github(personalized_message, "GigaChat-Plus", comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form, temperature),
575
  inputs=[
576
  personalized_output_text_gigachat_plus,
577
  comment_gigachat_plus,
@@ -585,13 +553,11 @@ with gr.Blocks() as demo:
585
  selections[2], # Психотип
586
  selections[3], # Стадия бизнеса
587
  selections[4], # Отрасль
588
- selections[5], # ОПФ
589
- gigachat_plus_temperature # Передача температуры
590
  ],
591
  outputs=None
592
  )
593
 
594
-
595
  # Использование сохраненных переменных в следующем блоке
596
  with gr.Row():
597
  check_errors_btn = gr.Button("3. Проверить текст (нажимать только после кнопки 2) - экспериментальная фича, качество пока крайне низкое", elem_id="check_errors_button")
 
76
  return prompt
77
 
78
  # Функции для генерации сообщений
79
+ def generate_message_gpt4o(prompt):
80
  try:
81
  headers = {
82
  "Content-Type": "application/json",
 
85
  data = {
86
  "model": "chatgpt-4o-latest",
87
  "messages": [{"role": "system", "content": prompt}],
88
+ "max_tokens": 101
 
89
  }
90
  response = requests.post("https://api.openai.com/v1/chat/completions", json=data, headers=headers)
91
  response_data = response.json()
92
+ return response_data["choices"][0]["message"]["content"].strip()
93
  except Exception as e:
94
  return f"Ошибка при обращении к ChatGPT-4o-Latest: {e}"
95
 
 
96
  def clean_message(message):
97
  # Если сообщение не заканчивается на точку или восклицательный знак, обрезаем его до последней точки
98
  if not message.endswith(('.', '!', '?')):
 
102
  return message
103
 
104
  # Обновленные функции генерации сообщений с учетом обрезки незаконченных предложений
105
+ def generate_message_gigachat_pro(prompt):
106
  try:
107
  messages = [SystemMessage(content=prompt)]
 
108
  res = chat_pro(messages)
109
  cleaned_message = clean_message(res.content.strip())
110
  return cleaned_message
111
  except Exception as e:
112
  return f"Ошибка при обращении к GigaChat-Pro: {e}"
113
 
114
+ def generate_message_gigachat_lite(prompt):
115
  try:
116
  time.sleep(2)
117
  messages = [SystemMessage(content=prompt)]
 
118
  res = chat_lite(messages)
119
  cleaned_message = clean_message(res.content.strip())
120
  return cleaned_message
121
  except Exception as e:
122
  return f"Ошибка при обращении к GigaChat-Lite: {e}"
123
 
124
+ def generate_message_gigachat_plus(prompt):
125
  try:
126
  time.sleep(2)
127
  messages = [SystemMessage(content=prompt)]
 
128
  res = chat_plus(messages)
129
  cleaned_message = clean_message(res.content.strip())
130
  return cleaned_message
131
  except Exception as e:
132
  return f"Ошибка при обращении к GigaChat-Plus: {e}"
133
 
134
+ def generate_message_gpt4o_with_retry(prompt):
135
  for _ in range(10): # Максимум 10 попыток
136
+ message = generate_message_gpt4o(prompt)
137
  if len(message) <= 250:
138
  return message
139
  return message # Возвращаем последнее сгенерированное сообщение, если все попытки не удались
140
 
141
+ def generate_message_gigachat_pro_with_retry(prompt):
142
  for _ in range(10):
143
+ message = generate_message_gigachat_pro(prompt)
144
  if len(message) <= 250:
145
  return message
146
  return message
147
 
148
+ def generate_message_gigachat_lite_with_retry(prompt):
149
  for _ in range(10):
150
+ message = generate_message_gigachat_lite(prompt)
151
  if len(message) <= 250:
152
  return message
153
  return message
154
 
155
+ def generate_message_gigachat_plus_with_retry(prompt):
156
  for _ in range(10):
157
+ message = generate_message_gigachat_plus(prompt)
158
  if len(message) <= 250:
159
  return message
160
  return message
161
 
 
 
 
162
 
163
+ # Обновляем генерацию сообщений для отображения в интерфейсе
164
+ def generate_messages(description, advantages, *selected_values):
165
+ standard_prompt = generate_standard_prompt(description, advantages, *selected_values)
166
 
167
  results = {
168
  "prompt": standard_prompt,
 
174
 
175
  yield results["prompt"], "", "", "", "", "Генерация стандартного промпта завершена"
176
 
177
+ results["gpt4o"] = generate_message_gpt4o_with_retry(standard_prompt)
178
  gpt4o_length = len(results["gpt4o"])
179
  gpt4o_display = f"{results['gpt4o']}\n\n------\nКоличество знаков: {gpt4o_length}"
180
  yield results["prompt"], gpt4o_display, "", "", "", "Сообщение GPT-4o сгенерировано"
181
 
182
+ results["gigachat_pro"] = generate_message_gigachat_pro_with_retry(standard_prompt)
183
  gigachat_pro_length = len(results["gigachat_pro"])
184
  gigachat_pro_display = f"{results['gigachat_pro']}\n\n------\nКоличество знаков: {gigachat_pro_length}"
185
  yield results["prompt"], gpt4o_display, gigachat_pro_display, "", "", "Сообщение GigaChat-Pro сгенерировано"
186
 
187
  time.sleep(2)
188
 
189
+ results["gigachat_lite"] = generate_message_gigachat_lite_with_retry(standard_prompt)
190
  gigachat_lite_length = len(results["gigachat_lite"])
191
  gigachat_lite_display = f"{results['gigachat_lite']}\n\n------\nКоличество знаков: {gigachat_lite_length}"
192
  yield results["prompt"], gpt4o_display, gigachat_pro_display, gigachat_lite_display, "", "Сообщение GigaChat-Lite сгенерировано"
193
 
194
  time.sleep(2)
195
 
196
+ results["gigachat_plus"] = generate_message_gigachat_plus_with_retry(standard_prompt)
197
  gigachat_plus_length = len(results["gigachat_plus"])
198
  gigachat_plus_display = f"{results['gigachat_plus']}\n\n------\nКоличество знаков: {gigachat_plus_length}"
199
  yield results["prompt"], gpt4o_display, gigachat_pro_display, gigachat_lite_display, gigachat_plus_display, "Все сообщения сгенерированы"
 
346
  yield error_check_prompt, error_message_gpt4o, error_message_gigachat_pro, error_message_gigachat_lite, error_message_gigachat_plus, "Все результаты проверки сгенерированы"
347
 
348
 
349
+ def save_to_github(personalized_message, model_name, comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form):
350
  # Собираем все данные в один словарь
351
  data_to_save = {
352
  "Модель": model_name,
 
353
  "Персонализированное сообщение": personalized_message,
354
  "Комментарий": comment,
355
  "Откорректированное сообщение": corrected_message,
 
384
  # Отправка POST-запроса на GitHub API для создания файла в репозитории
385
  response = requests.put(url, headers=headers, data=json.dumps(data))
386
 
 
 
 
 
 
 
387
 
388
  # Создание интерфейса Gradio
389
  with gr.Blocks() as demo:
390
  gr.Markdown("# Генерация SMS-сообщений по заданным ��ризнакам")
391
 
 
 
 
 
 
 
392
  with gr.Row():
393
  with gr.Column(scale=1):
394
  description_input = gr.Textbox(
 
428
  output_text_gigachat_lite = gr.Textbox(label="Неперсонализированное сообщение GigaChat-Lite", lines=3, interactive=False)
429
  output_text_gigachat_plus = gr.Textbox(label="Неперсонализированное сообщение GigaChat-Lite+", lines=3, interactive=False)
430
 
431
+ submit_btn.click(
432
+ generate_messages,
433
+ inputs=[description_input, advantages_input] + selections,
434
+ outputs=[prompt_display, output_text_gpt4o, output_text_gigachat_pro, output_text_gigachat_lite, output_text_gigachat_plus]
435
+ )
 
 
 
 
 
 
 
 
 
436
 
437
  with gr.Row():
438
  personalize_btn = gr.Button("2. Выполнить персонализацию (нажимать только после кнопки 1)", elem_id="personalize_button")
 
475
 
476
  # Привязка кнопок к функциям сохранения
477
  save_gpt4o_btn.click(
478
+ fn=lambda personalized_message, comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form:
479
+ save_to_github(personalized_message, "GPT-4o", comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form),
480
  inputs=[
481
  personalized_output_text_gpt4o,
482
  comment_gpt4o,
 
490
  selections[2], # Психотип
491
  selections[3], # Стадия бизнеса
492
  selections[4], # Отрасль
493
+ selections[5] # ОПФ
 
494
  ],
495
  outputs=None
496
  )
497
+
498
  save_gigachat_pro_btn.click(
499
+ fn=lambda personalized_message, comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form:
500
+ save_to_github(personalized_message, "GigaChat-Pro", comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form),
501
  inputs=[
502
  personalized_output_text_gigachat_pro,
503
  comment_gigachat_pro,
 
511
  selections[2], # Психотип
512
  selections[3], # Стадия бизнеса
513
  selections[4], # Отрасль
514
+ selections[5] # ОПФ
 
515
  ],
516
  outputs=None
517
  )
518
+
519
  save_gigachat_lite_btn.click(
520
+ fn=lambda personalized_message, comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form:
521
+ save_to_github(personalized_message, "GigaChat-Lite", comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form),
522
  inputs=[
523
  personalized_output_text_gigachat_lite,
524
  comment_gigachat_lite,
 
532
  selections[2], # Психотип
533
  selections[3], # Стадия бизнеса
534
  selections[4], # Отрасль
535
+ selections[5] # ОПФ
 
536
  ],
537
  outputs=None
538
  )
539
+
540
  save_gigachat_plus_btn.click(
541
+ fn=lambda personalized_message, comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form:
542
+ save_to_github(personalized_message, "GigaChat-Lite+", comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form),
543
  inputs=[
544
  personalized_output_text_gigachat_plus,
545
  comment_gigachat_plus,
 
553
  selections[2], # Психотип
554
  selections[3], # Стадия бизнеса
555
  selections[4], # Отрасль
556
+ selections[5] # ОПФ
 
557
  ],
558
  outputs=None
559
  )
560
 
 
561
  # Использование сохраненных переменных в следующем блоке
562
  with gr.Row():
563
  check_errors_btn = gr.Button("3. Проверить текст (нажимать только после кнопки 2) - экспериментальная фича, качество пока крайне низкое", elem_id="check_errors_button")