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

Anything after <file_sep> to be stripped from completion #268

Closed
robertpiosik opened this issue Jul 6, 2024 · 8 comments
Closed

Anything after <file_sep> to be stripped from completion #268

robertpiosik opened this issue Jul 6, 2024 · 8 comments

Comments

@robertpiosik
Copy link

Describe the bug
When using starcoder2:3b my completions contain fim tokens.
My workaround is to split output on <file_sep>.

To Reproduce
starcoder2:3b with ollama

Screenshots
image
image

@rjmacarthy
Copy link
Collaborator

rjmacarthy commented Jul 8, 2024

Hello, I just released a new version which adds <file_sep to stop words for starcoder models. Many thanks.

057c1a1

@robertpiosik
Copy link
Author

robertpiosik commented Jul 8, 2024

@rjmacarthy What your change does is removing <file_sep> token from output. What needs to be done is removing also all the following tokens after <file_sep>. It looks broken on starcoder end but it is what it is 🤷

So now, with this change I can't use my hacky method of splitting on <file_sep> because it's no longer there:P

@robertpiosik
Copy link
Author

Ok I did a little research and what is needed is ability to set stop sequence on options key in request body.

here is what works with llm vscode extension:

  "llm.requestBody": {
    "stream": true,
    "options": {
      "stop": [
        "<file_sep>"
      ],
      "temperature": 0,
    }
  },

@rjmacarthy
Copy link
Collaborator

rjmacarthy commented Jul 8, 2024

Hello @robertpiosik the change to remove the stop word is the correct approach as we don't want in the final output, in order for you to continue working with starcoder2 you need to create the correct Modelfile for Ollama and specify your stop words in the configuration. All the best. https://github.com/ollama/ollama/blob/main/docs/modelfile.md#valid-parameters-and-values

@robertpiosik
Copy link
Author

Ok, thank you!

@rjmacarthy
Copy link
Collaborator

Hey @robertpiosik did that work for you? Many thanks.

@robertpiosik
Copy link
Author

I decided to use llm-vscode. Setting up custom request body with a stop sequence is more convenient to me, also I don't need Twinny's sidebar features as my vram capacity can fit only phi3-mini which I find quite poorly performing in my use case. Anyway, fantastic work with the extension, cheers!

@rjmacarthy
Copy link
Collaborator

Ok no worries. Thanks for the help, all the best!

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

2 participants