各位佬友,想基于Qwen训练一个类似于cursor中Tab Model

这个类似于tab model的model不是用在写代码上,而是对话的预测和回答文本补全上的,想问问大佬们有没有思路。

不用训练吧

不是代码补全,是“对话补全”。佬友的意思是不是也学引用帖子一样只修改modelfile来实现我的场景而不需要训练呢。

对啊,FIM(Fill-In-the-Middle)就是大语言模型的补全技术,虽然可以专门训练一个模型(一般代码优化的模型都支持的很好),不过,Qwen3 应该在做训练时做了这种方式的训练,支持补全,FIM 不仅仅针对代码,同时也适用于一般文本,它做的就是,允许模型根据给定的上下文来填充文本或代码中的空白部分。

1 个赞

对话补全,直接用提示词就好了,不用专门训练,基础模型的能力是完全足够的,给个 open-WebUI 的提示词你参考

### Task:
You are an autocompletion system. Continue the text in `<text>` based on the **completion type** in `<type>` and the given language.  

### **Instructions**:
1. Analyze `<text>` for context and meaning.  
2. Use `<type>` to guide your output:  
   - **General**: Provide a natural, concise continuation.  
   - **Search Query**: Complete as if generating a realistic search query.  
3. Start as if you are directly continuing `<text>`. Do **not** repeat, paraphrase, or respond as a model. Simply complete the text.  
4. Ensure the continuation:
   - Flows naturally from `<text>`.  
   - Avoids repetition, overexplaining, or unrelated ideas.  
5. If unsure, return: `{ "text": "" }`.  

### **Output Rules**:
- Respond only in JSON format: `{ "text": "<your_completion>" }`.

### **Examples**:
#### Example 1:  
Input:  
<type>General</type>  
<text>The sun was setting over the horizon, painting the sky</text>  
Output:  
{ "text": "with vibrant shades of orange and pink." }

#### Example 2:  
Input:  
<type>Search Query</type>  
<text>Top-rated restaurants in</text>  
Output:  
{ "text": "New York City for Italian cuisine." }  

---
### Context:
<chat_history>
{{MESSAGES:END:6}}
</chat_history>
<type>{{TYPE}}</type>  
<text>{{PROMPT}}</text>  
#### Output:
4 个赞

qwen3挺聪明的,一般来说并不需要单独训练,给一个mcp工具,让他按照函数调用规则,来做预测题或者填空题就可以了。

当然如果你原始聊天数据量很大,远超上下文限制的,那只能微调试试了。

谢谢佬友的回复,很有帮助。

首先感谢各位佬友的回复,我想了一下我的场景好像是模型训练时就应该兼容的场景了,但是如果对性能有要求该从什么方向入手呢。

佬友我如果对性能有需求,该从哪个方向入手。

别用满血模型,用低参数量的版本,另外还可以上量化的版本,就是你要对比看看,那个版本的能力能满足的你要求,量化+参数量降了,模型的能力会下降

1 个赞

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。