Update app.py
Browse files
app.py
CHANGED
|
@@ -38,6 +38,7 @@ def translate_text(text, lang=None, progress=gr.Progress(track_tqdm=True)):
|
|
| 38 |
# Build conversation history
|
| 39 |
messages = []
|
| 40 |
message = "Translate to "+lang+": "+text
|
|
|
|
| 41 |
# Add system message if provided
|
| 42 |
if system_message:
|
| 43 |
messages.append({"role": "system", "content": system_message})
|
|
@@ -94,7 +95,7 @@ def chat_with_model(prompt, system_prompt, chatbot_display, internal_history,lan
|
|
| 94 |
prompt = prompt.replace(expected_key, "")
|
| 95 |
if lang != None:
|
| 96 |
prompt = translate_text(prompt,"English")
|
| 97 |
-
print(prompt)
|
| 98 |
# 1. Khởi tạo nếu đây là lần chạy đầu tiên
|
| 99 |
# chatbot_display là [[user_msg, ai_msg], ...]
|
| 100 |
if chatbot_display is None:
|
|
|
|
| 38 |
# Build conversation history
|
| 39 |
messages = []
|
| 40 |
message = "Translate to "+lang+": "+text
|
| 41 |
+
print("message : "+message)
|
| 42 |
# Add system message if provided
|
| 43 |
if system_message:
|
| 44 |
messages.append({"role": "system", "content": system_message})
|
|
|
|
| 95 |
prompt = prompt.replace(expected_key, "")
|
| 96 |
if lang != None:
|
| 97 |
prompt = translate_text(prompt,"English")
|
| 98 |
+
print("prompt : "+prompt)
|
| 99 |
# 1. Khởi tạo nếu đây là lần chạy đầu tiên
|
| 100 |
# chatbot_display là [[user_msg, ai_msg], ...]
|
| 101 |
if chatbot_display is None:
|