Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab completion adds unnecessary lines #3591

Open
3 tasks done
Glas42 opened this issue Jan 2, 2025 · 0 comments
Open
3 tasks done

Tab completion adds unnecessary lines #3591

Glas42 opened this issue Jan 2, 2025 · 0 comments
Assignees
Labels
area:autocomplete Relates to the auto complete feature ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior "needs-triage"

Comments

@Glas42
Copy link

Glas42 commented Jan 2, 2025

Before submitting your bug report

Relevant environment info

- OS: Windows 11
- Continue version: v0.8.66
- IDE version: VSCode 1.96.2
- Model: Qwen2.5-Coder-1.5B (Ollama)
- config.json:
  
{
  "tabAutocompleteModel": {
    "title": "Autocomplete: Qwen2.5-Coder-1.5B",
    "provider": "ollama",
    "model": "qwen2.5-coder:1.5b",
    "apiBase": "http://localhost:11434"
  },
  "tabAutocompleteOptions": {
    "debounceDelay": 150,
    "maxPromptTokens": 4096,
    "multilineCompletions": "never"
  },
  "models": [
  ],
  "customCommands": [
  ],
  "embeddingsProvider": {
    "provider": "free-trial"
  },
  "reranker": {
    "name": "free-trial"
  },
  "allowAnonymousTelemetry": false,
  "docs": []
}

Description

The tab completion always inserts an empty line when accepting a completion, it happens with any kind of file type.
I was said it is most likely, the bug is related to the postprocessCompletion function or to streamCompletionWithFilters.
https://github.com/continuedev/continue/blob/main/core/autocomplete/postprocessing/index.ts#L55
https://github.com/continuedev/continue/blob/main/core/autocomplete/generation/CompletionStreamer.ts#L16

Example.mp4

To reproduce

No response

Log output

##### Completion options #####
{
  "contextLength": 8096,
  "model": "qwen2.5-coder:1.5b",
  "maxTokens": 4096,
  "temperature": 0.01,
  "stop": [
    "<|endoftext|>",
    "<|fim_prefix|>",
    "<|fim_middle|>",
    "<|fim_suffix|>",
    "<|fim_pad|>",
    "<|repo_name|>",
    "<|file_sep|>",
    "<|im_start|>",
    "<|im_end|>",
    "/src/",
    "#- coding: utf-8",
    ""
  ]
}

##### Prompt #####
Prefix: 
# Downloads/temp.py
import math
import time

def CalculatePI(n):
    
Suffix: 
==========================================================================
==========================================================================
Completion:
sum = 0
    for i in range(1, n+1):
        sum += (4 * pow(-1, i-1)) / i
    return sum

start_time = time.time()
pi_estimate = CalculatePI(100000)
end_time = time.time()

print(f"Estimated value of pi: {pi_estimate}")
print(f"Time taken to calculate pi: {end_time - start_time} seconds")

==========================================================================
==========================================================================
##### Completion options #####
{
  "contextLength": 8096,
  "model": "qwen2.5-coder:1.5b",
  "maxTokens": 4096,
  "temperature": 0.01,
  "stop": [
    "<|endoftext|>",
    "<|fim_prefix|>",
    "<|fim_middle|>",
    "<|fim_suffix|>",
    "<|fim_pad|>",
    "<|repo_name|>",
    "<|file_sep|>",
    "<|im_start|>",
    "<|im_end|>",
    "/src/",
    "#- coding: utf-8",
    "```"
  ]
}

##### Prompt #####
Prefix: 
# Downloads/temp.py
import math
import time

def CalculatePI(n):
    sum = 0
    for i in range(1, n+1):
        sum += (4 * pow(-1, i-1)) / i
        
Suffix: 


==========================================================================
==========================================================================
Completion:
print("Current value of pi: ", sum)
        time.sleep(2)

CalculatePI(1000)

==========================================================================
==========================================================================
##### Completion options #####
{
  "contextLength": 8096,
  "model": "qwen2.5-coder:1.5b",
  "maxTokens": 4096,
  "temperature": 0.01,
  "stop": [
    "<|endoftext|>",
    "<|fim_prefix|>",
    "<|fim_middle|>",
    "<|fim_suffix|>",
    "<|fim_pad|>",
    "<|repo_name|>",
    "<|file_sep|>",
    "<|im_start|>",
    "<|im_end|>",
    "/src/",
    "#- coding: utf-8",
    "```"
  ]
}

##### Prompt #####
Prefix: 
# Downloads/temp.py
import math
import time

def CalculatePI(n):
    sum = 0
    for i in range(1, n+1):
        sum += (4 * pow(-1, i-1)) / i
        print("Current value of pi: ", sum)
        time.sleep(2)
        
Suffix: 




==========================================================================
==========================================================================
##### Completion options #####
{
  "contextLength": 8096,
  "model": "qwen2.5-coder:1.5b",
  "maxTokens": 4096,
  "temperature": 0.01,
  "stop": [
    "<|endoftext|>",
    "<|fim_prefix|>",
    "<|fim_middle|>",
    "<|fim_suffix|>",
    "<|fim_pad|>",
    "<|repo_name|>",
    "<|file_sep|>",
    "<|im_start|>",
    "<|im_end|>",
    "/src/",
    "#- coding: utf-8",
    "```"
  ]
}

##### Prompt #####
Prefix: 
# Downloads/temp.py
import math
import time

def CalculatePI(n):
    sum = 0
    for i in range(1, n+1):
        sum += (4 * pow(-1, i-1)) / i
        print("Current value of pi: ", sum)
        time.sleep(2)
        return sum
    
Suffix: 





==========================================================================
==========================================================================
Completion:
print(CalculatePI(100000))


==========================================================================
==========================================================================
##### Completion options #####
{
  "contextLength": 8096,
  "model": "qwen2.5-coder:1.5b",
  "maxTokens": 4096,
  "temperature": 0.01,
  "stop": [
    "<|endoftext|>",
    "<|fim_prefix|>",
    "<|fim_middle|>",
    "<|fim_suffix|>",
    "<|fim_pad|>",
    "<|repo_name|>",
    "<|file_sep|>",
    "<|im_start|>",
    "<|im_end|>",
    "/src/",
    "#- coding: utf-8",
    "```"
  ]
}

##### Prompt #####
Prefix: 
# Downloads/temp.py
import math
import time

def CalculatePI(n):
    sum = 0
    for i in range(1, n+1):
        sum += (4 * pow(-1, i-1)) / i
        print("Current value of pi: ", sum)
        time.sleep(2)
        return sum
    print(CalculatePI(100000))
    
Suffix: 






==========================================================================
==========================================================================
Completion:
@dosubot dosubot bot added area:autocomplete Relates to the auto complete feature ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior labels Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:autocomplete Relates to the auto complete feature ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior "needs-triage"
Projects
None yet
Development

No branches or pull requests

2 participants