fruitpicker01 commited on
Commit
45b048f
·
verified ·
1 Parent(s): cf48def

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -16
app.py CHANGED
@@ -391,7 +391,6 @@ def save_to_github(personalized_message, model_name, comment, corrected_message,
391
  response = requests.put(url, headers=headers, data=json.dumps(data))
392
 
393
 
394
-
395
  # Создание интерфейса Gradio
396
  with gr.Blocks() as demo:
397
  gr.Markdown("# Генерация SMS-сообщений по заданным признакам")
@@ -497,8 +496,8 @@ with gr.Blocks() as demo:
497
 
498
  # Привязка кнопок к функциям сохранения
499
  save_gpt4o_btn.click(
500
- fn=lambda personalized_message, comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form:
501
- 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),
502
  inputs=[
503
  personalized_output_text_gpt4o,
504
  comment_gpt4o,
@@ -512,14 +511,15 @@ with gr.Blocks() as demo:
512
  selections[2], # Психотип
513
  selections[3], # Стадия бизнеса
514
  selections[4], # Отрасль
515
- selections[5] # ОПФ
 
516
  ],
517
  outputs=None
518
  )
519
-
520
  save_gigachat_pro_btn.click(
521
- fn=lambda personalized_message, comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form:
522
- 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),
523
  inputs=[
524
  personalized_output_text_gigachat_pro,
525
  comment_gigachat_pro,
@@ -533,14 +533,15 @@ with gr.Blocks() as demo:
533
  selections[2], # Психотип
534
  selections[3], # Стадия бизнеса
535
  selections[4], # Отрасль
536
- selections[5] # ОПФ
 
537
  ],
538
  outputs=None
539
  )
540
-
541
  save_gigachat_lite_btn.click(
542
- fn=lambda personalized_message, comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form:
543
- 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),
544
  inputs=[
545
  personalized_output_text_gigachat_lite,
546
  comment_gigachat_lite,
@@ -554,14 +555,15 @@ with gr.Blocks() as demo:
554
  selections[2], # Психотип
555
  selections[3], # Стадия бизнеса
556
  selections[4], # Отрасль
557
- selections[5] # ОПФ
 
558
  ],
559
  outputs=None
560
  )
561
-
562
  save_gigachat_plus_btn.click(
563
- fn=lambda personalized_message, comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form:
564
- 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),
565
  inputs=[
566
  personalized_output_text_gigachat_plus,
567
  comment_gigachat_plus,
@@ -575,11 +577,13 @@ with gr.Blocks() as demo:
575
  selections[2], # Психотип
576
  selections[3], # Стадия бизнеса
577
  selections[4], # Отрасль
578
- selections[5] # ОПФ
 
579
  ],
580
  outputs=None
581
  )
582
 
 
583
  # Использование сохраненных переменных в следующем блоке
584
  with gr.Row():
585
  check_errors_btn = gr.Button("3. Проверить текст (нажимать только после кнопки 2) - экспериментальная фича, качество пока крайне низкое", elem_id="check_errors_button")
 
391
  response = requests.put(url, headers=headers, data=json.dumps(data))
392
 
393
 
 
394
  # Создание интерфейса Gradio
395
  with gr.Blocks() as demo:
396
  gr.Markdown("# Генерация SMS-сообщений по заданным признакам")
 
496
 
497
  # Привязка кнопок к функциям сохранения
498
  save_gpt4o_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, temperature:
500
+ 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),
501
  inputs=[
502
  personalized_output_text_gpt4o,
503
  comment_gpt4o,
 
511
  selections[2], # Психотип
512
  selections[3], # Стадия бизнеса
513
  selections[4], # Отрасль
514
+ selections[5], # ОПФ
515
+ gpt4o_temperature # Передача температуры
516
  ],
517
  outputs=None
518
  )
519
+
520
  save_gigachat_pro_btn.click(
521
+ fn=lambda personalized_message, comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form, temperature:
522
+ 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),
523
  inputs=[
524
  personalized_output_text_gigachat_pro,
525
  comment_gigachat_pro,
 
533
  selections[2], # Психотип
534
  selections[3], # Стадия бизнеса
535
  selections[4], # Отрасль
536
+ selections[5], # ОПФ
537
+ gigachat_pro_temperature # Передача температуры
538
  ],
539
  outputs=None
540
  )
541
+
542
  save_gigachat_lite_btn.click(
543
+ fn=lambda personalized_message, comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form, temperature:
544
+ 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),
545
  inputs=[
546
  personalized_output_text_gigachat_lite,
547
  comment_gigachat_lite,
 
555
  selections[2], # Психотип
556
  selections[3], # Стадия бизнеса
557
  selections[4], # Отрасль
558
+ selections[5], # ОПФ
559
+ gigachat_lite_temperature # Передача температуры
560
  ],
561
  outputs=None
562
  )
563
+
564
  save_gigachat_plus_btn.click(
565
+ fn=lambda personalized_message, comment, corrected_message, description, advantages, non_personalized_prompt, non_personalized_message, gender, generation, psychotype, business_stage, industry, legal_form, temperature:
566
+ 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),
567
  inputs=[
568
  personalized_output_text_gigachat_plus,
569
  comment_gigachat_plus,
 
577
  selections[2], # Психотип
578
  selections[3], # Стадия бизнеса
579
  selections[4], # Отрасль
580
+ selections[5], # ОПФ
581
+ gigachat_plus_temperature # Передача температуры
582
  ],
583
  outputs=None
584
  )
585
 
586
+
587
  # Использование сохраненных переменных в следующем блоке
588
  with gr.Row():
589
  check_errors_btn = gr.Button("3. Проверить текст (нажимать только после кнопки 2) - экспериментальная фича, качество пока крайне низкое", elem_id="check_errors_button")