Commit Graph

2 Commits

Author SHA1 Message Date
Jason Kneen
4372071fc5 Modify message handling logic to merge successive messages of the same role
* Remove check for interleaved user and assistant messages
2025-01-22 16:33:52 +00:00
Jason Kneen
837e17f55c Fix message handling in deepseek-reasoner
Fixes #21

Add support for successive user or assistant messages in `deepseek-reasoner`.

* **deepseek_reasoner.py**: 
  - Modify the message handling logic to allow successive messages of the same role.
  - Add a check to merge successive messages of the same role into a single message.
  - Update the `process_messages` function to handle the new message format.

* **README.md**: 
  - Add a section explaining the new message handling capability.
  - Provide examples of how to format messages with successive user or assistant messages.

* **test_deepseek_reasoner.py**: 
  - Add tests to ensure the model correctly processes successive user or assistant messages.
  - Include test cases for both interleaved and successive messages.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/deepseek-ai/DeepSeek-R1/issues/21?shareId=XXXX-XXXX-XXXX-XXXX).
2025-01-22 15:17:35 +00:00