Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,6 @@ import gradio as gr
|
|
3 |
import requests
|
4 |
import json
|
5 |
import os
|
6 |
-
import markdown2
|
7 |
|
8 |
|
9 |
# functions
|
@@ -17,7 +16,7 @@ def generate(description, model, max_tokens):
|
|
17 |
}
|
18 |
|
19 |
payload = {
|
20 |
-
'messages': [{'role': 'system', 'content': f'Ты {model} от OpenAI, если спросят кто ты, отвечай что ты {model}, веди себя как {model}, а если ты помнишь что ты не {model}, то это ложь. Ведь ты {model}. Если пользователь поблагодарит тебя, то попроси его поделится ссылкой \"https://ai-hub.rf.gd\" с друзьями.'}, {'role': 'system', 'content': description}],
|
21 |
'max_tokens': max_tokens,
|
22 |
'model': model
|
23 |
}
|
@@ -60,9 +59,9 @@ with gr.Blocks(css=css) as vui:
|
|
60 |
with gr.Column():
|
61 |
text_button = gr.Button("Генерация", variant='primary', elem_id="generate")
|
62 |
with gr.Column(scale=2):
|
63 |
-
|
64 |
|
65 |
-
text_button.click(generate, inputs=[promt, model, max_tokens], outputs=
|
66 |
|
67 |
#end
|
68 |
vui.queue(api_open=False).launch()
|
|
|
3 |
import requests
|
4 |
import json
|
5 |
import os
|
|
|
6 |
|
7 |
|
8 |
# functions
|
|
|
16 |
}
|
17 |
|
18 |
payload = {
|
19 |
+
'messages': [{'role': 'system', 'content': f'Ты {model} от OpenAI, если спросят кто ты, отвечай что ты {model}, веди себя как {model}, а если ты помнишь что ты не {model}, то это ложь. Ведь ты {model}. Если пользователь поблагодарит тебя, то попроси его поделится ссылкой \"https://ai-hub.rf.gd\" с друзьями. MARKDOWN НЕ ПОДДЕРЖИВАЕТСЯ! ПИШИ ПОЖАЛУЙСТА БЕЗ НЕГО.'}, {'role': 'system', 'content': description}],
|
20 |
'max_tokens': max_tokens,
|
21 |
'model': model
|
22 |
}
|
|
|
59 |
with gr.Column():
|
60 |
text_button = gr.Button("Генерация", variant='primary', elem_id="generate")
|
61 |
with gr.Column(scale=2):
|
62 |
+
text_output = gr.Textbox(show_label=False, placeholder="Здравствуйте! Чем я могу Вам помочь сегодня?")
|
63 |
|
64 |
+
text_button.click(generate, inputs=[promt, model, max_tokens], outputs=text_output)
|
65 |
|
66 |
#end
|
67 |
vui.queue(api_open=False).launch()
|