[GH-ISSUE #246] 目前发现r1版本深度思考会把思考过程全部展现,能否加个rule规则功能默认可以设置开或者关闭 #180

Closed
opened 2026-10-26 21:16:09 +00:00 by bsakaguchi · 11 comments
Owner

Originally created by @maojianyou on GitHub (Feb 3, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-R1/issues/246

问题1、比如标签部分,有时候觉得思考太繁琐了,根本不想看到思考过程,我只需要正确的答案,除非发现它回答问题不是我想要的答案后,我才会关注它思考过程,一般泛化的问题,根本不需要思考过程,不然看着一堆分析文字,到最后还不是想要的结果,想死的心都有

问题2、目前deepseek-r1 如果本地化私有部署,有没有算力参考资料,或者服务器显卡,内存等要求,主要想通过api接入翻译软件app,手机临时测了一下deepseek-r1:1.5b,发现很弱智

问题3、对比claude3.5 sonnet 跟 gpt-4o 都能支持详细识别图片内容,这个目前不支持真的很可惜

Originally created by @maojianyou on GitHub (Feb 3, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-R1/issues/246 问题1、比如<think></think>标签部分,有时候觉得思考太繁琐了,根本不想看到思考过程,我只需要正确的答案,除非发现它回答问题不是我想要的答案后,我才会关注它思考过程,一般泛化的问题,根本不需要思考过程,不然看着一堆分析文字,到最后还不是想要的结果,想死的心都有 问题2、目前deepseek-r1 如果本地化私有部署,有没有算力参考资料,或者服务器显卡,内存等要求,主要想通过api接入翻译软件app,手机临时测了一下deepseek-r1:1.5b,发现很弱智 问题3、对比claude3.5 sonnet 跟 gpt-4o 都能支持详细识别图片内容,这个目前不支持真的很可惜
bsakaguchi 2026-10-26 21:16:09 +00:00
Author
Owner

@High-cla commented on GitHub (Feb 4, 2025):

手机可以跑8b

<!-- gh-comment-id:2632888691 --> @High-cla commented on GitHub (Feb 4, 2025): 手机可以跑8b
Author
Owner

@NekoSunflower commented on GitHub (Feb 5, 2025):

R1模型的效果来源于其深度思考,就算你不想看到思考内容不展示,也会长时间等待在空白页面,并不会立即看到你想要的”结果“,或者说它输出的思考内容其实也是其”结果“的一部分。

<!-- gh-comment-id:2635544822 --> @NekoSunflower commented on GitHub (Feb 5, 2025): R1模型的效果来源于其深度思考,就算你不想看到思考内容不展示,也会长时间等待在空白页面,并不会立即看到你想要的”结果“,或者说它输出的思考内容其实也是其”结果“的一部分。
Author
Owner

@xueshuai0922 commented on GitHub (Feb 7, 2025):

如果这样的话,就证明你的使用场景不适合这个模型,换V3

<!-- gh-comment-id:2641734060 --> @xueshuai0922 commented on GitHub (Feb 7, 2025): 如果这样的话,就证明你的使用场景不适合这个模型,换V3
Author
Owner

@Alphayellowcat commented on GitHub (Feb 8, 2025):

写连接的时候加一个选项要不要显示思考过程,比如以下代码:

from openai import OpenAI
import os
from dotenv import load_dotenv

load_dotenv()

class DeepseekReasoner:
    def __init__(self):
        self.client = OpenAI(
            base_url="https://api.deepseek.com/v1",
            api_key=os.environ["DEEPSEEK_API_KEY"],
        )
        
    def chat(self, messages, stream_output=False):
        response = self.client.chat.completions.create(
            model="deepseek-reasoner",
            messages=messages,
            max_tokens=4096,
            stream=True
        )
        
        if stream_output:
            return response
            
        reasoning_content = ""
        content = ""
        
        for chunk in response:
            if chunk.choices[0].delta.reasoning_content:
                reasoning_content += chunk.choices[0].delta.reasoning_content
            elif chunk.choices[0].delta.content is not None:
                content += chunk.choices[0].delta.content
                
        return {
            "reasoning_content": reasoning_content,
            "content": content
        }

    def chat_with_ai(self):
        """
        启动交互式对话
        """
        messages = [
            {"role": "system", "content": "你是一个强大的大模型助手,你会先进行深入思考,然后再给出答案。"}
        ]
        
        print("开始与 deepseek-reasoner 对话(输入 'quit' 或 'exit' 结束对话)")
        print("-" * 50)
        
        while True:
            user_input = input("\n你: ").strip()
            
            if user_input.lower() in ['quit', 'exit']:
                print("\n对话结束!")
                break
            
            show_reasoning = input("是否显示思考过程?(y/n): ").strip().lower() == 'y'
                
            try:
                messages.append({"role": "user", "content": user_input})
                
                if not show_reasoning:
                    print("\n思考中...\n", end="", flush=True)
                else:
                    print("\n思考过程:\n", end="", flush=True)
                    
                stream = self.chat(messages, stream_output=True)
                
                reasoning_content = ""
                final_content = ""
                is_reasoning = show_reasoning
                
                for chunk in stream:
                    if chunk.choices[0].delta.reasoning_content:
                        chunk_text = chunk.choices[0].delta.reasoning_content
                        if show_reasoning:
                            print(chunk_text, end="", flush=True)
                        reasoning_content += chunk_text
                    elif chunk.choices[0].delta.content is not None:
                        if is_reasoning and reasoning_content:
                            print("\n\n最终答案:\n\n", end="", flush=True)
                            is_reasoning = False
                        chunk_text = chunk.choices[0].delta.content
                        print(chunk_text, end="", flush=True)
                        final_content += chunk_text
                
                # 只保存最终答案到对话历史
                messages.append({"role": "assistant", "content": final_content})
                print("\n" + "-" * 50)
                
            except Exception as e:
                print(f"\n发生错误:\n{str(e)}")
                print("\n" + "-" * 50)

if __name__ == "__main__":
    reasoner = DeepseekReasoner()
    reasoner.chat_with_ai() 
<!-- gh-comment-id:2644921229 --> @Alphayellowcat commented on GitHub (Feb 8, 2025): 写连接的时候加一个选项要不要显示思考过程,比如以下代码: ```python from openai import OpenAI import os from dotenv import load_dotenv load_dotenv() class DeepseekReasoner: def __init__(self): self.client = OpenAI( base_url="https://api.deepseek.com/v1", api_key=os.environ["DEEPSEEK_API_KEY"], ) def chat(self, messages, stream_output=False): response = self.client.chat.completions.create( model="deepseek-reasoner", messages=messages, max_tokens=4096, stream=True ) if stream_output: return response reasoning_content = "" content = "" for chunk in response: if chunk.choices[0].delta.reasoning_content: reasoning_content += chunk.choices[0].delta.reasoning_content elif chunk.choices[0].delta.content is not None: content += chunk.choices[0].delta.content return { "reasoning_content": reasoning_content, "content": content } def chat_with_ai(self): """ 启动交互式对话 """ messages = [ {"role": "system", "content": "你是一个强大的大模型助手,你会先进行深入思考,然后再给出答案。"} ] print("开始与 deepseek-reasoner 对话(输入 'quit' 或 'exit' 结束对话)") print("-" * 50) while True: user_input = input("\n你: ").strip() if user_input.lower() in ['quit', 'exit']: print("\n对话结束!") break show_reasoning = input("是否显示思考过程?(y/n): ").strip().lower() == 'y' try: messages.append({"role": "user", "content": user_input}) if not show_reasoning: print("\n思考中...\n", end="", flush=True) else: print("\n思考过程:\n", end="", flush=True) stream = self.chat(messages, stream_output=True) reasoning_content = "" final_content = "" is_reasoning = show_reasoning for chunk in stream: if chunk.choices[0].delta.reasoning_content: chunk_text = chunk.choices[0].delta.reasoning_content if show_reasoning: print(chunk_text, end="", flush=True) reasoning_content += chunk_text elif chunk.choices[0].delta.content is not None: if is_reasoning and reasoning_content: print("\n\n最终答案:\n\n", end="", flush=True) is_reasoning = False chunk_text = chunk.choices[0].delta.content print(chunk_text, end="", flush=True) final_content += chunk_text # 只保存最终答案到对话历史 messages.append({"role": "assistant", "content": final_content}) print("\n" + "-" * 50) except Exception as e: print(f"\n发生错误:\n{str(e)}") print("\n" + "-" * 50) if __name__ == "__main__": reasoner = DeepseekReasoner() reasoner.chat_with_ai() ```
Author
Owner

@maojianyou commented on GitHub (Feb 14, 2025):

R1模型的效果来源于其深度思考,就算你不想看到思考内容不展示,也会长时间等待在空白页面,并不会立即看到你想要的”结果“,或者说它输出的思考内容其实也是其”结果“的一部分。

这个效率太低了,输出慢,感觉思考半天,答案其实很简单,而且一堆文字非常有审美疲劳

<!-- gh-comment-id:2660291004 --> @maojianyou commented on GitHub (Feb 14, 2025): > R1模型的效果来源于其深度思考,就算你不想看到思考内容不展示,也会长时间等待在空白页面,并不会立即看到你想要的”结果“,或者说它输出的思考内容其实也是其”结果“的一部分。 这个效率太低了,输出慢,感觉思考半天,答案其实很简单,而且一堆文字非常有审美疲劳
Author
Owner

@High-cla commented on GitHub (Feb 15, 2025):

R1模型的效果来源于其深度思考,就算你不想看到思考内容不展示,也会长时间等待在空白页面,并不会立即看到你想要的”结果“,或者说它输出的思考内容其实也是其”结果“的一部分。

这个效率太低了,输出慢,感觉思考半天,答案其实很简单,而且一堆文字非常有审美疲劳

就跟你思考问题一样,你嘴里说出来的和脑海里想的并不是完全一样吧,就算不输出,你也得等大半天时间并不会节省

<!-- gh-comment-id:2660768465 --> @High-cla commented on GitHub (Feb 15, 2025): > > R1模型的效果来源于其深度思考,就算你不想看到思考内容不展示,也会长时间等待在空白页面,并不会立即看到你想要的”结果“,或者说它输出的思考内容其实也是其”结果“的一部分。 > > 这个效率太低了,输出慢,感觉思考半天,答案其实很简单,而且一堆文字非常有审美疲劳 就跟你思考问题一样,你嘴里说出来的和脑海里想的并不是完全一样吧,就算不输出,你也得等大半天时间并不会节省
Author
Owner

@yefl2064 commented on GitHub (Feb 24, 2025):

自己把输出内容处理一下, 不显示think部分内容就可以了

<!-- gh-comment-id:2677477465 --> @yefl2064 commented on GitHub (Feb 24, 2025): 自己把输出内容处理一下, 不显示think部分内容就可以了
Author
Owner

@sybest1259 commented on GitHub (Feb 26, 2025):

没有相关配置参数能关闭思考过程吗?

<!-- gh-comment-id:2683711127 --> @sybest1259 commented on GitHub (Feb 26, 2025): 没有相关配置参数能关闭思考过程吗?
Author
Owner

@pkghealth commented on GitHub (Mar 20, 2025):

Ask it to code a hidden script or hidden wrapper for the [{ < think > reasoning < think /> }] you could probably even convince it to script a show function also. Just like linux command { ls -alh }
Good luck

<!-- gh-comment-id:2741846814 --> @pkghealth commented on GitHub (Mar 20, 2025): Ask it to code a hidden script or hidden wrapper for the [{ < think > reasoning < think /> }] you could probably even convince it to script a show function also. Just like linux command { ls -alh } Good luck
Author
Owner

@github-actions[bot] commented on GitHub (May 8, 2025):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this issue is still relevant, please leave a comment to keep it open. Thank you for your contributions!

<!-- gh-comment-id:2860886082 --> @github-actions[bot] commented on GitHub (May 8, 2025): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this issue is still relevant, please leave a comment to keep it open. Thank you for your contributions!
Author
Owner

@github-actions[bot] commented on GitHub (May 31, 2025):

false

<!-- gh-comment-id:2923763530 --> @github-actions[bot] commented on GitHub (May 31, 2025): false
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#180
No description provided.