Update app.py
Browse files
app.py
CHANGED
@@ -91,7 +91,7 @@ def predict(system_msg, inputs, top_p, temperature, chat_counter, chatbot=None,
|
|
91 |
|
92 |
chat_counter += 1
|
93 |
history.append(inputs)
|
94 |
-
print(f"Logging: Payload is - {payload}")
|
95 |
|
96 |
# Kullanıcı mesajını dosyaya yaz
|
97 |
try:
|
@@ -104,7 +104,8 @@ def predict(system_msg, inputs, top_p, temperature, chat_counter, chatbot=None,
|
|
104 |
# Chatbot'a kullanıcı mesajını ekle
|
105 |
chatbot.append({"role": "user", "content": inputs})
|
106 |
response = requests.post(API_URL, headers=headers, json=payload, stream=True)
|
107 |
-
print(f"Logging: Response code - {response.status_code}")
|
|
|
108 |
if response.status_code != 200:
|
109 |
print(f"API hatası: {response.text}")
|
110 |
return chatbot, history, chat_counter
|
@@ -114,7 +115,6 @@ def predict(system_msg, inputs, top_p, temperature, chat_counter, chatbot=None,
|
|
114 |
for chunk in response.iter_lines():
|
115 |
if not chunk:
|
116 |
continue
|
117 |
-
# Chunk çıktısını artık log dosyasına eklemiyoruz, sadece son yanıtı topluyoruz.
|
118 |
chunk_str = chunk.decode('utf-8')
|
119 |
if chunk_str.startswith("data: ") and chunk_str != "data: [DONE]":
|
120 |
try:
|
|
|
91 |
|
92 |
chat_counter += 1
|
93 |
history.append(inputs)
|
94 |
+
# Debug çıktısı kaldırıldı: print(f"Logging: Payload is - {payload}")
|
95 |
|
96 |
# Kullanıcı mesajını dosyaya yaz
|
97 |
try:
|
|
|
104 |
# Chatbot'a kullanıcı mesajını ekle
|
105 |
chatbot.append({"role": "user", "content": inputs})
|
106 |
response = requests.post(API_URL, headers=headers, json=payload, stream=True)
|
107 |
+
# Debug çıktısı kaldırıldı: print(f"Logging: Response code - {response.status_code}")
|
108 |
+
|
109 |
if response.status_code != 200:
|
110 |
print(f"API hatası: {response.text}")
|
111 |
return chatbot, history, chat_counter
|
|
|
115 |
for chunk in response.iter_lines():
|
116 |
if not chunk:
|
117 |
continue
|
|
|
118 |
chunk_str = chunk.decode('utf-8')
|
119 |
if chunk_str.startswith("data: ") and chunk_str != "data: [DONE]":
|
120 |
try:
|