Update app.py
Browse files
app.py
CHANGED
@@ -62,7 +62,7 @@ def predict(system_msg, inputs, top_p, temperature, chat_counter, chatbot=None,
|
|
62 |
print(f"System message: {system_msg}")
|
63 |
|
64 |
multi_turn_message = [
|
65 |
-
{"role": "system", "content": "Bir önceki sohbeti
|
66 |
]
|
67 |
|
68 |
messages = multi_turn_message.copy()
|
@@ -169,7 +169,7 @@ def upload_logs_to_hf(repo_id: str, hf_token: str, local_log_file: str = "chat_l
|
|
169 |
Log dosyasını Hugging Face Hub repository'sine yükler.
|
170 |
|
171 |
Args:
|
172 |
-
|
173 |
hf_token (str): Hugging Face API token'ınız.
|
174 |
local_log_file (str): Yüklenecek log dosyasının yolu.
|
175 |
"""
|
@@ -259,10 +259,8 @@ with gr.Blocks(css=demo_css, theme=theme) as demo:
|
|
259 |
)
|
260 |
with gr.Column(elem_classes="fixed_button_container"):
|
261 |
send_button = gr.Button(value="Gönder", elem_id="send_button")
|
262 |
-
save_button = gr.Button(value="Kayıt Et", elem_id="save_button")
|
263 |
|
264 |
state = gr.State([])
|
265 |
-
save_status = gr.Textbox(label="Kayıt Durum", interactive=False)
|
266 |
|
267 |
with gr.Accordion("", open=False, visible=False):
|
268 |
top_p = gr.Slider(minimum=0, maximum=1.0, value=0.5, step=0.05, interactive=False, visible=False)
|
@@ -273,6 +271,6 @@ with gr.Blocks(css=demo_css, theme=theme) as demo:
|
|
273 |
inputs.submit(reset_textbox, [], [inputs])
|
274 |
send_button.click(predict, [system_msg, inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter])
|
275 |
send_button.click(reset_textbox, [], [inputs])
|
276 |
-
|
277 |
|
278 |
demo.queue(max_size=10).launch(debug=True)
|
|
|
62 |
print(f"System message: {system_msg}")
|
63 |
|
64 |
multi_turn_message = [
|
65 |
+
{"role": "system", "content": "Bir önceki sohbeti unutma. Vereceğin ürün bilgisi, bu bilginin içinde yan yana yazmıyorsa veya arada başka bilgiler yazıyor ise, o bilgiyi vermeyeceksin çünkü o bilgi yanlıştır. ... (uzun metin)"}
|
66 |
]
|
67 |
|
68 |
messages = multi_turn_message.copy()
|
|
|
169 |
Log dosyasını Hugging Face Hub repository'sine yükler.
|
170 |
|
171 |
Args:
|
172 |
+
repo_id (str): Repository kimliği (örn. "SamiKoen/BF").
|
173 |
hf_token (str): Hugging Face API token'ınız.
|
174 |
local_log_file (str): Yüklenecek log dosyasının yolu.
|
175 |
"""
|
|
|
259 |
)
|
260 |
with gr.Column(elem_classes="fixed_button_container"):
|
261 |
send_button = gr.Button(value="Gönder", elem_id="send_button")
|
|
|
262 |
|
263 |
state = gr.State([])
|
|
|
264 |
|
265 |
with gr.Accordion("", open=False, visible=False):
|
266 |
top_p = gr.Slider(minimum=0, maximum=1.0, value=0.5, step=0.05, interactive=False, visible=False)
|
|
|
271 |
inputs.submit(reset_textbox, [], [inputs])
|
272 |
send_button.click(predict, [system_msg, inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter])
|
273 |
send_button.click(reset_textbox, [], [inputs])
|
274 |
+
send_button.click(save_chat_and_upload, [chatbot], [])
|
275 |
|
276 |
demo.queue(max_size=10).launch(debug=True)
|