xu song commited on
Commit
7d0829c
1 Parent(s): 2b9d822
Files changed (1) hide show
  1. models/cpp_qwen2.py +8 -8
models/cpp_qwen2.py CHANGED
@@ -146,12 +146,12 @@ if __name__ == "__main__":
146
  # output = bot.generate_response(messages)
147
  # print(output)
148
 
149
- message = {"role": "system", "content": "你是一个导游。"}
150
- print(message)
151
- for generated_text, all_tokens in bot.generate_query(message, stream=True):
152
- print(generated_text, all_tokens)
153
-
154
- message = {"role": "user", "content": generated_text}
155
- print(message)
156
- for generated_text, all_tokens in bot.generate_response(message, all_tokens, stream=True):
157
  print(generated_text, all_tokens)
 
146
  # output = bot.generate_response(messages)
147
  # print(output)
148
 
149
+ messages = [{"role": "system", "content": "你是一个导游。"}]
150
+ print(messages)
151
+ for generated_text, generated_tokens in bot.generate_query(messages, stream=True):
152
+ print(generated_text, generated_tokens)
153
+
154
+ messages.append({"role": "user", "content": generated_text, "tokens": generated_tokens})
155
+ print(messages)
156
+ for generated_text, all_tokens in bot.generate_response(messages, stream=True):
157
  print(generated_text, all_tokens)