[PR #45] Fix message handling in deepseek-reasoner #750

Open
opened 2026-10-26 21:26:23 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/deepseek-ai/DeepSeek-R1/pull/45
Author: @jasonkneen
Created: 1/22/2025
Status: 🔄 Open

Base: main ← Head: fix-message-handling


📝 Commits (2)

  • 837e17f Fix message handling in deepseek-reasoner
  • 4372071 Modify message handling logic to merge successive messages of the same role

📊 Changes

3 files changed (+127 additions, -3 deletions)

View changed files

📝 README.md (+35 -3)
➕ deepseek_reasoner.py (+46 -0)
➕ test_deepseek_reasoner.py (+46 -0)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/deepseek-ai/DeepSeek-R1/pull/45 **Author:** [@jasonkneen](https://github.com/jasonkneen) **Created:** 1/22/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix-message-handling` --- ### 📝 Commits (2) - [`837e17f`](https://github.com/deepseek-ai/DeepSeek-R1/commit/837e17f55c8d543254daf02befddc8bb1581589f) Fix message handling in deepseek-reasoner - [`4372071`](https://github.com/deepseek-ai/DeepSeek-R1/commit/4372071fc5f19427f36061a7a0db9fa2169cb994) Modify message handling logic to merge successive messages of the same role ### 📊 Changes **3 files changed** (+127 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+35 -3) ➕ `deepseek_reasoner.py` (+46 -0) ➕ `test_deepseek_reasoner.py` (+46 -0) </details> ### 📄 Description 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/pull/45?shareId=006b54bc-bf2b-482e-93cd-8f459f848d03). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepSeek-R1#750
No description provided.