Update app.py
Browse files
app.py
CHANGED
@@ -15,6 +15,9 @@ from google.oauth2.service_account import Credentials
|
|
15 |
from googleapiclient.discovery import build
|
16 |
from googleapiclient.http import MediaIoBaseDownload
|
17 |
import io
|
|
|
|
|
|
|
18 |
|
19 |
# Gradio uyarılarını bastır
|
20 |
warnings.filterwarnings("ignore", category=UserWarning, module="gradio.components.chatbot")
|
@@ -386,7 +389,7 @@ def chatbot_fn(user_message, history):
|
|
386 |
messages = system_messages + history + [{"role": "user", "content": user_message}]
|
387 |
|
388 |
payload = {
|
389 |
-
"model": "gpt-4.
|
390 |
"messages": messages,
|
391 |
"temperature": 0.2,
|
392 |
"top_p": 1,
|
@@ -449,14 +452,15 @@ chat_fn = slow_echo if USE_SLOW_ECHO else chatbot_fn
|
|
449 |
if not USE_SLOW_ECHO:
|
450 |
scheduler_thread = threading.Thread(target=run_scheduler, args=(global_chat_history,), daemon=True)
|
451 |
scheduler_thread.start()
|
452 |
-
|
453 |
demo = gr.ChatInterface(
|
454 |
fn=chat_fn,
|
455 |
title="Trek Asistanı",
|
456 |
theme="default",
|
|
|
457 |
flagging_mode="manual",
|
458 |
flagging_options=["Doğru", "Yanlış", "Emin değilim", "Diğer"],
|
459 |
-
|
460 |
)
|
461 |
|
462 |
if __name__ == "__main__":
|
|
|
15 |
from googleapiclient.discovery import build
|
16 |
from googleapiclient.http import MediaIoBaseDownload
|
17 |
import io
|
18 |
+
import warnings
|
19 |
+
from requests.packages.urllib3.exceptions import InsecureRequestWarning
|
20 |
+
warnings.simplefilter('ignore', InsecureRequestWarning)
|
21 |
|
22 |
# Gradio uyarılarını bastır
|
23 |
warnings.filterwarnings("ignore", category=UserWarning, module="gradio.components.chatbot")
|
|
|
389 |
messages = system_messages + history + [{"role": "user", "content": user_message}]
|
390 |
|
391 |
payload = {
|
392 |
+
"model": "gpt-4.1",
|
393 |
"messages": messages,
|
394 |
"temperature": 0.2,
|
395 |
"top_p": 1,
|
|
|
452 |
if not USE_SLOW_ECHO:
|
453 |
scheduler_thread = threading.Thread(target=run_scheduler, args=(global_chat_history,), daemon=True)
|
454 |
scheduler_thread.start()
|
455 |
+
|
456 |
demo = gr.ChatInterface(
|
457 |
fn=chat_fn,
|
458 |
title="Trek Asistanı",
|
459 |
theme="default",
|
460 |
+
type="messages",
|
461 |
flagging_mode="manual",
|
462 |
flagging_options=["Doğru", "Yanlış", "Emin değilim", "Diğer"],
|
463 |
+
save_history=True
|
464 |
)
|
465 |
|
466 |
if __name__ == "__main__":
|