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

How to use this in continue with Ollama? #94

Open
dayekuaipao opened this issue Sep 19, 2024 · 11 comments
Open

How to use this in continue with Ollama? #94

dayekuaipao opened this issue Sep 19, 2024 · 11 comments

Comments

@dayekuaipao
Copy link

No description provided.

@Shadowfita
Copy link

I have the same question! Auto complete doesn't seem to be working for some reason.

@SlavikCA
Copy link

Here is my config:

  "models": [
    {
      "title": "qwen2.5-coder",
      "provider": "ollama",
      "model": "qwen2.5-coder:7b-instruct-q6_K",
      "apiBase": "http://192.168.0.44:11434/"
    }
  ],

Of course, the model has to be downloaded first.

Auto-complete doesn't work for me, too.

@huybery
Copy link
Member

huybery commented Sep 23, 2024

Please give us some time to give you all a best practice.

@dayekuaipao
Copy link
Author

Here is my config:


  "models": [

    {

      "title": "qwen2.5-coder",

      "provider": "ollama",

      "model": "qwen2.5-coder:7b-instruct-q6_K",

      "apiBase": "http://192.168.0.44:11434/"

    }

  ],

Of course, the model has to be downloaded first.

Auto-complete doesn't work for me, too.

you should use base model for autocompleting, but it doesn't work too.

@SlavikCA
Copy link

So, the the rule is to use base model for autocompleting and instruct model for chat?
Or can base model be used for chat, too?

@dayekuaipao
Copy link
Author

So, the the rule is to use base model for autocompleting and instruct model for chat?

Or can base model be used for chat, too?

you should use instruct model for chat, it works. And you should use base model for autocompleting,it works for other model such as starcoder, but not for this model

@Shadowfita
Copy link

It's interesting because the readme talks about autocomplete support. I wonder if this is an issue with the continue.dev extension and the way it implements it, rather than the model.

@asmeurer
Copy link

asmeurer commented Sep 23, 2024

FIM does seem to work with qwen2.5-coder-base:

$ollama run qwen2.5-coder:7b-base
>>> <|fim_prefix|>def fib(n):<|fim_suffix|>    return b<|fim_middle|>

   a = 0
   b = 1

   for i in range(2,n+1):
      c=a+b
      a=b
      b=c
<|endoftext|>class Solution(object):

(I control-C'd there because the ollama model doesn't seem to be configured to stop on <|endoftext|>).

I believe this needs to be added to the continue templates file https://github.com/continuedev/continue/blob/main/core/autocomplete/templates.ts

However, there may be a way to configure a template directly with continue https://docs.continue.dev/customize/config (maybe the tabAutocompleteOptions/template key?)

@rjmacarthy
Copy link

Hey all, FYI I've added support for this model using Ollama recently in https://github.com/twinnydotdev/twinny. Hope it helps someone. All the best.

@SlavikCA
Copy link

Looks like autocomplete for Qwen2.5-coder will be added to continue.dev, too:

continuedev/continue#2330

@LNTH
Copy link

LNTH commented Sep 25, 2024

This is a workaround solution for autocomplete with vllm (I don't use ollama).
I also found that Instruct model can work with autocomplete so I just have to load 1 model for both tasks (chat & autocomplete).

vllm serve Orion-zhen/Qwen2.5-Coder-7B-Instruct-AWQ --quantization awq --disable-log-requests --disable-log-stats

Continue config.json

{
  "models": [
    {
      "title": "Qwen2.5-Coder-7B-Instruct",
      "provider": "openai",
      "apiBase": "http://192.168.1.19:8000/v1/",
      "model": "Orion-zhen/Qwen2.5-Coder-7B-Instruct-AWQ"
    }
  ],
  "tabAutocompleteModel": {
    "title": "Qwen2.5-Coder-7B-Instruct",
    "provider": "openai",
    "apiKey": "None",
    "completionOptions": {
      "stop": [
        "<|endoftext|>",
        "\n"
      ]
    },
    "apiBase": "http://192.168.1.19:8000/v1/",
    "model": "Orion-zhen/Qwen2.5-Coder-7B-Instruct-AWQ"
  },
  "tabAutocompleteOptions": {
    "multilineCompletions": "never",
    "template": "You are a helpful assistant.<|fim_prefix|>{{{ prefix }}}<|fim_suffix|>{{{ suffix }}}<|fim_middle|>"
  },
  "customCommands": [],
  "allowAnonymousTelemetry": false,
  "docs": []
}

continuedev/continue#2388

Edit: correct config.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants