Spaces:
Sleeping
Sleeping
Commit
·
c15a0fa
1
Parent(s):
3e5f6ae
met roi do
Browse files
app.py
CHANGED
@@ -46,10 +46,12 @@ def respond(message, history: list[tuple[str, str]], system_message, max_tokens,
|
|
46 |
eos_token_id=tokenizer.eos_token_id,
|
47 |
pad_token_id=tokenizer.pad_token_id,
|
48 |
)
|
49 |
-
print('!!!! OUTPUTS: ',outputs)
|
50 |
# 2.5 — Decode và tách phần assistant trả lời
|
51 |
response = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
|
|
|
52 |
response = response.split("### Trả lời:")[1]
|
|
|
53 |
yield response
|
54 |
|
55 |
# 2.6 — Cập nhật history và trả về
|
|
|
46 |
eos_token_id=tokenizer.eos_token_id,
|
47 |
pad_token_id=tokenizer.pad_token_id,
|
48 |
)
|
49 |
+
print('!!!! OUTPUTS 1: ',outputs)
|
50 |
# 2.5 — Decode và tách phần assistant trả lời
|
51 |
response = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
|
52 |
+
print('!!!! OUTPUTS 2: ',response)
|
53 |
response = response.split("### Trả lời:")[1]
|
54 |
+
print('!!!! OUTPUTS 3: ',response)
|
55 |
yield response
|
56 |
|
57 |
# 2.6 — Cập nhật history và trả về
|