xu song
commited on
Commit
•
0064c50
1
Parent(s):
aa1923f
update
Browse files- models/cpp_qwen2.py +6 -3
models/cpp_qwen2.py
CHANGED
@@ -129,13 +129,16 @@ if __name__ == "__main__":
|
|
129 |
# print(output)
|
130 |
|
131 |
messages = [{"role": "system", "content": "你是一个导游。"}]
|
|
|
132 |
print("######## requesting", messages)
|
133 |
-
for generated_text, generated_tokens in bot.
|
134 |
print(generated_text, generated_tokens)
|
135 |
|
|
|
136 |
for i in range(3):
|
137 |
messages.append({"role": "user" if i % 2 == 0 else "assistant", "content": generated_text, "tokens": generated_tokens})
|
138 |
print("######## requesting", messages)
|
139 |
-
for generated_text,
|
140 |
-
|
|
|
141 |
|
|
|
129 |
# print(output)
|
130 |
|
131 |
messages = [{"role": "system", "content": "你是一个导游。"}]
|
132 |
+
generated_tokens = None
|
133 |
print("######## requesting", messages)
|
134 |
+
for generated_text, generated_tokens in bot.generate(messages, stream=True):
|
135 |
print(generated_text, generated_tokens)
|
136 |
|
137 |
+
|
138 |
for i in range(3):
|
139 |
messages.append({"role": "user" if i % 2 == 0 else "assistant", "content": generated_text, "tokens": generated_tokens})
|
140 |
print("######## requesting", messages)
|
141 |
+
for generated_text, generated_tokens in bot.generate(messages, stream=True):
|
142 |
+
pass
|
143 |
+
# print(generated_text, all_tokens)
|
144 |
|