Giter Club home page Giter Club logo

Comments (3)

moyix avatar moyix commented on April 26, 2024

It is 2048 tokens (one token can represent multiple characters so this is a decent amount of text). This is also the same limit Github Copilot uses, so it mostly works, but the tokenizer used by CodeGen vs Copilot are slightly different, which sometimes causes the VSCode Copilot send a prompt that is too long for CodeGen (but would have been fine for Copilot).

I think that this can be fixed by replacing the vocab.bpe and tokenizer.json files in the .vscode/extensions/github.copilot-[version]/ directory (after backing them up of course) with the ones in this directory. I haven't added this to the README yet though because I haven't had time to test it out, so do let me know if it works!

from fauxpilot.

smith-co avatar smith-co commented on April 26, 2024

@moyix for codex the context length is 8,000 tokens. Am I missing something?

Reference: https://beta.openai.com/docs/models/codex-series-private-beta

from fauxpilot.

moyix avatar moyix commented on April 26, 2024

Yes – there are multiple Codex models. code-davinci-002 goes up to 8000 tokens; code-cushman-001 goes up to 2048. It's not known exactly which model Copilot is currently using (they changed things in the extension so it doesn't show the engine name any more), but at least when it was released they were using Cushman.

It's also possible that by this point Copilot is using a non-public model that they or OpenAI fine-tuned for them. But you should be able to verify that it uses 2048 tokens by looking at the requests Copilot sends; if you run them through the Codex tokenizer the prompt + tokens requested add up to 2048. You can also look into Copilot's extension.js and find:

let _={maxPromptLength:2048-(0,o.getConfig)(e,o.ConfigKey.SolutionLength)

I suspect they use the smaller model because they care a lot about latency and Cushman is quite a bit faster than DaVinci.

from fauxpilot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.