Giter Site home page Giter Site logo

InvalidRequestError: This model's maximum context length is 4097 tokens. However, your messages resulted in 7575 tokens. Please reduce the length of the messages. about developer HOT 7 OPEN

smol-ai avatar smol-ai commented on July 3, 2024 3
InvalidRequestError: This model's maximum context length is 4097 tokens. However, your messages resulted in 7575 tokens. Please reduce the length of the messages.

from developer.

Comments (7)

swyxio avatar swyxio commented on July 3, 2024 1

yeah honeslty smol debugger is quite underdeveloped now, i think i know how to solve this but i was leaving it to another day. i might actually split it out to a separate project since it is so useful to run on existing codebases. (aka i'd love to package it up into a binary you can download or brew install)

from developer.

swyxio avatar swyxio commented on July 3, 2024 1

basically i plan to chunk the code and put it in chroma, and then bundle it up in to a standalone binary #13

from developer.

localjo avatar localjo commented on July 3, 2024 1

I created an app with:

modal run main.py --prompt "A minimal React app that just displays the text 'Hello, World' in the browser"

It had a small error preventing it from running, so I put that into the debugger:

modal run debugger.py --prompt "Module not found: Error: Can't resolve './App' in '/Users/localjo/smol-dev/generated/src'"

And I got "InvalidRequestError: This model's maximum context length is 4097 tokens. However, your messages resulted in 2188582 tokens. Please reduce the length of the messages." 🤯

Is it trying to put all of the node_modules dependencies in?

from developer.

BlackNipples avatar BlackNipples commented on July 3, 2024

is this the following error?

InvalidRequestError: This model's maximum context
length is 4097 tokens. However, you requested 4151
tokens (151 in the messages, 4000 in the
completion). Please reduce the length of the
messages or completion.

from developer.

swyxio avatar swyxio commented on July 3, 2024

yeah sorry guys this is a bad pain point.

would take a PR to:

  1. check token length (use tiktoken) and report a nice friendly error saying we are working on it
  2. for @localjo yeah we need to respect gitignore and not check the node_modules

from developer.

BlackNipples avatar BlackNipples commented on July 3, 2024

should the program divide the prompt in chunks? just like auto-gpt?

from developer.

swyxio avatar swyxio commented on July 3, 2024

@BlackNipples i'm tackling the problem a different way - more details in the body of this post https://www.latent.space/p/function-agents#details

from developer.

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.