mirror of
https://github.com/deepseek-ai/DeepSeek-VL2.git
synced 2026-11-05 01:07:23 +00:00
[PR #144] feat: add automatic language detection for responses #148
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepSeek-VL2#148
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/deepseek-ai/DeepSeek-VL2/pull/144
Author: @Libres-coder
Created: 11/12/2025
Status: 🔄 Open
Base:
main← Head:main📝 Commits (2)
a037ee9feat: add automatic language detection for responses4ee6b38add📊 Changes
2 files changed (+19 additions, -2 deletions)
View changed files
📝
deepseek_vl2/serve/inference.py(+6 -0)📝
web_demo.py(+13 -2)📄 Description
Summary:
This PR introduces automatic language detection for user input, enabling DeepSeek-VL2 to dynamically adjust its response language (e.g., Chinese or English) based on the detected input language. This resolves the issue where the model would sometimes unexpectedly switch to English during Chinese conversations.
Key Changes:
web_demo.py:langdetectimport.predictfunction.generate_prompt_with_historyto set a system message based on the detected language.deepseek_vl2/serve/inference.py:convert_conversation_to_promptsto include the system message in the conversation payload passed to the model.requirements.txt:langdetectas a dependency.Problem Solved:
Previously, the model could inconsistently switch its response language, even when the user maintained a single language (e.g., Chinese). This change ensures the model receives a clear language instruction via a system message, leading to stable and contextually appropriate language responses.
Verification Steps:
pip install -r requirements.txtpython web_demo.py --model_name DeepSeek-VL2-tiny🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.