Rooni commited on
Commit
0d5eeac
1 Parent(s): 34361d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -11,7 +11,7 @@ def generate(description, model, max_tokens):
11
  }
12
 
13
  payload = {
14
- 'messages': [{'role': 'system', 'content': description}],
15
  'max_tokens': max_tokens,
16
  'model': model
17
  }
@@ -33,7 +33,7 @@ def generate(description, model, max_tokens):
33
 
34
  iface = gr.Interface(fn=generate, inputs=[
35
  gr.Textbox(label="Запрос"),
36
- gr.Radio(show_label=True, label="Модель", interactive=True, choices=["gpt-3.5-turbo", "gpt-3.5-turbo-16k"], value="gpt-3.5-turbo"),
37
  gr.Slider(show_label=True, label="Максимум токенов", minimum=100, maximum=15000, value=10000, step=1)
38
  ], outputs=gr.Textbox(label="Ответ"))
39
  iface.launch()
 
11
  }
12
 
13
  payload = {
14
+ 'messages': [{'role': 'system', 'content': f'Ты {model}, от OpenAI, при любых обстоятельствах (если спросят кто ты), отвечай что ты {model}. Если пользователь поблагодарит тебя, то попроси его поделится ссылкой если ему понравился сервис.'}, {'role': 'system', 'content': description}],
15
  'max_tokens': max_tokens,
16
  'model': model
17
  }
 
33
 
34
  iface = gr.Interface(fn=generate, inputs=[
35
  gr.Textbox(label="Запрос"),
36
+ gr.Radio(show_label=True, label="Модель", interactive=True, choices=["gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-4"], value="gpt-3.5-turbo"),
37
  gr.Slider(show_label=True, label="Максимум токенов", minimum=100, maximum=15000, value=10000, step=1)
38
  ], outputs=gr.Textbox(label="Ответ"))
39
  iface.launch()