fruitpicker01 commited on
Commit
f8f69c5
·
verified ·
1 Parent(s): e4312aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -15,9 +15,9 @@ gc_key = os.getenv('GC_KEY')
15
  token = os.getenv('GITHUB_TOKEN')
16
 
17
  # Авторизация в сервисе GigaChat
18
- chat_pro = GigaChat(credentials=gc_key, model='GigaChat-Pro', max_tokens=65, verify_ssl_certs=False)
19
- chat_lite = GigaChat(credentials=gc_key, model='GigaChat', max_tokens=65, verify_ssl_certs=False)
20
- chat_plus = GigaChat(credentials=gc_key, model='GigaChat-Plus', max_tokens=65, verify_ssl_certs=False)
21
 
22
  # Загрузка данных из Excel-файла
23
  try:
@@ -85,7 +85,7 @@ def generate_message_gpt4o(prompt):
85
  data = {
86
  "model": "chatgpt-4o-latest",
87
  "messages": [{"role": "system", "content": prompt}],
88
- "max_tokens": 115
89
  }
90
  response = requests.post("https://api.openai.com/v1/chat/completions", json=data, headers=headers)
91
  response_data = response.json()
@@ -361,7 +361,7 @@ with gr.Blocks() as demo:
361
  submit_btn = gr.Button("1. Создать неперсонализированное сообщение") # Оранжевая кнопка по умолчанию
362
 
363
  with gr.Column(scale=2):
364
- prompt_display = gr.Textbox(label="Неперсонализированный промпт", lines=28, interactive=False)
365
  output_text_gpt4o = gr.Textbox(label="Неперсонализированное сообщение GPT-4o", lines=3, interactive=False)
366
  output_text_gigachat_pro = gr.Textbox(label="Неперсонализированное сообщение GigaChat-Pro", lines=3, interactive=False)
367
  output_text_gigachat_lite = gr.Textbox(label="Неперсонализированное сообщение GigaChat-Lite", lines=3, interactive=False)
 
15
  token = os.getenv('GITHUB_TOKEN')
16
 
17
  # Авторизация в сервисе GigaChat
18
+ chat_pro = GigaChat(credentials=gc_key, model='GigaChat-Pro', max_tokens=60, verify_ssl_certs=False)
19
+ chat_lite = GigaChat(credentials=gc_key, model='GigaChat', max_tokens=60, verify_ssl_certs=False)
20
+ chat_plus = GigaChat(credentials=gc_key, model='GigaChat-Plus', max_tokens=60, verify_ssl_certs=False)
21
 
22
  # Загрузка данных из Excel-файла
23
  try:
 
85
  data = {
86
  "model": "chatgpt-4o-latest",
87
  "messages": [{"role": "system", "content": prompt}],
88
+ "max_tokens": 110
89
  }
90
  response = requests.post("https://api.openai.com/v1/chat/completions", json=data, headers=headers)
91
  response_data = response.json()
 
361
  submit_btn = gr.Button("1. Создать неперсонализированное сообщение") # Оранжевая кнопка по умолчанию
362
 
363
  with gr.Column(scale=2):
364
+ prompt_display = gr.Textbox(label="Неперсонализированный промпт", lines=20, interactive=False)
365
  output_text_gpt4o = gr.Textbox(label="Неперсонализированное сообщение GPT-4o", lines=3, interactive=False)
366
  output_text_gigachat_pro = gr.Textbox(label="Неперсонализированное сообщение GigaChat-Pro", lines=3, interactive=False)
367
  output_text_gigachat_lite = gr.Textbox(label="Неперсонализированное сообщение GigaChat-Lite", lines=3, interactive=False)