Merge pull request #6594 from NGC13009/qwen3supportINautocomplete
Qwen3 support for autocomplete function
This commit is contained in:
commit
5dba368be9
7 changed files with 49 additions and 13 deletions
|
|
@ -103,6 +103,16 @@ export function postprocessCompletion({
|
|||
}
|
||||
}
|
||||
|
||||
if (llm.model.includes("qwen3")) {
|
||||
// Qwen3 always starts from special thinking markers, and we don't want them to output these contents
|
||||
// Remove all content from "
|
||||
completion = completion.replace(/<think>.*?<\/think>/s, "");
|
||||
completion = completion.replace(/<\/think>/, "");
|
||||
|
||||
// Remove any number of newline characters at the beginning and end
|
||||
completion = completion.replace(/^\n+|\n+$/g, "");
|
||||
}
|
||||
|
||||
if (llm.model.includes("mercury") || llm.model.includes("granite")) {
|
||||
// Granite tends to repeat the start of the line in the completion output
|
||||
let prefixEnd = prefix.split("\n").pop();
|
||||
|
|
|
|||
6
core/package-lock.json
generated
6
core/package-lock.json
generated
|
|
@ -142,7 +142,7 @@
|
|||
},
|
||||
"../packages/config-yaml": {
|
||||
"name": "@continuedev/config-yaml",
|
||||
"version": "1.0.95",
|
||||
"version": "1.0.96",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
|
|
@ -169,9 +169,11 @@
|
|||
},
|
||||
"../packages/openai-adapters": {
|
||||
"name": "@continuedev/openai-adapters",
|
||||
"version": "1.0.44",
|
||||
"version": "1.0.45",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-bedrock-runtime": "^3.842.0",
|
||||
"@aws-sdk/credential-providers": "^3.840.0",
|
||||
"@continuedev/config-types": "^1.0.5",
|
||||
"@continuedev/config-yaml": "^1.0.51",
|
||||
"@continuedev/fetch": "^1.0.15",
|
||||
|
|
|
|||
|
|
@ -84,6 +84,30 @@ Then, add the model to your configuration:
|
|||
|
||||
Once the model has been downloaded, you should begin to see completions in VS Code.
|
||||
|
||||
NOTE: Typically, thinking-type models are not recommended as they generate more slowly and are not suitable for scenarios that require speed.
|
||||
|
||||
However, if you use any thinking-switchable models, you can configure these models for autocomplete functions by turning off the thinking mode.
|
||||
|
||||
For example:
|
||||
|
||||
<Tabs>
|
||||
<Tab title="YAML">
|
||||
```yaml title="config.yaml"
|
||||
models:
|
||||
- name: Qwen3 without Thinking for Autocomplete
|
||||
provider: ollama
|
||||
model: qwen3:4b # qwen3 is a thinking-switchable model
|
||||
roles:
|
||||
- autocomplete
|
||||
requestOptions:
|
||||
extraBodyProperties:
|
||||
think: false # turning off the thinking
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
Then, in the continue panel, select this model as the default model for autocomplete.
|
||||
|
||||
## Configuration Options
|
||||
|
||||
### Hub Autocomplete models
|
||||
|
|
@ -138,12 +162,12 @@ Yes, in VS Code, if you don't want to be shown suggestions automatically you can
|
|||
|
||||
This is a built-in feature of VS Code, but it's just a bit hidden. Follow these settings to reassign the keyboard shortcuts in VS Code:
|
||||
|
||||
1. Press `Ctrl+Shift+P`, type the command: `Preferences: Open Keyboard Shortcuts`, and enter the keyboard shortcuts settings page.
|
||||
1. Press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>, type the command: `Preferences: Open Keyboard Shortcuts`, and enter the keyboard shortcuts settings page.
|
||||
2. Search for `editor.action.inlineSuggest.acceptNextLine`.
|
||||
3. Set the key binding to `Tab`.
|
||||
3. Set the key binding to <kbd>Tab</kbd>.
|
||||
4. Set the trigger condition (when) to `inlineSuggestionVisible && !editorReadonly`.
|
||||
This will make multi-line completion (including continue and from VS Code built-in or other plugin snippets) still work, and you will see multi-line completion. However, Tab will only fill in one line at a time. Any unnecessary code can be canceled with `Esc`.
|
||||
If you need to apply all the code, just press `Tab` multiple times.
|
||||
This will make multi-line completion (including continue and from VS Code built-in or other plugin snippets) still work, and you will see multi-line completion. However, Tab will only fill in one line at a time. Any unnecessary code can be canceled with <kbd>Esc</kbd>.
|
||||
If you need to apply all the code, just press <kbd>Tab</kbd> multiple times.
|
||||
|
||||
### How to turn off autocomplete
|
||||
|
||||
|
|
|
|||
4
extensions/vscode/package-lock.json
generated
4
extensions/vscode/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "1.1.59",
|
||||
"version": "1.1.60",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "1.1.59",
|
||||
"version": "1.1.60",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
|
|
|
|||
2
gui/package-lock.json
generated
2
gui/package-lock.json
generated
|
|
@ -220,7 +220,7 @@
|
|||
},
|
||||
"../packages/config-yaml": {
|
||||
"name": "@continuedev/config-yaml",
|
||||
"version": "1.0.95",
|
||||
"version": "1.0.96",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
|
|
|
|||
4
packages/config-yaml/package-lock.json
generated
4
packages/config-yaml/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@continuedev/config-yaml",
|
||||
"version": "1.0.95",
|
||||
"version": "1.0.96",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@continuedev/config-yaml",
|
||||
"version": "1.0.95",
|
||||
"version": "1.0.96",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
|
|
|
|||
4
packages/openai-adapters/package-lock.json
generated
4
packages/openai-adapters/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@continuedev/openai-adapters",
|
||||
"version": "1.0.44",
|
||||
"version": "1.0.45",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@continuedev/openai-adapters",
|
||||
"version": "1.0.44",
|
||||
"version": "1.0.45",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-bedrock-runtime": "^3.842.0",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue