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

Hitting input token limit on local language models #22

Open
Ademsk1 opened this issue May 3, 2024 · 3 comments
Open

Hitting input token limit on local language models #22

Ademsk1 opened this issue May 3, 2024 · 3 comments

Comments

@Ademsk1
Copy link

Ademsk1 commented May 3, 2024

When scraping fairly large websites, we hit the token limit and receive the GGML_ASSERT error:

 n_tokens_all <= cparams.n_batch

For smaller websites this isn't an issue.

We should think about decomposing the website into chunks if it hits a certain length threshold, summarising each chunk using the local language model, and then stitch together these summaries coherently using the model once more.

Another thought I've had is to take screenshots instead using playwright, and get some text recognition in there. Or perhaps even better, if there is a playwright method to only extract the text content, and leave the html entirely.

@DraconPern
Copy link

The example https://news.ycombinator.com actually runs into this. I get a GGML_ASSERT: D:\a\node-llama-cpp\node-llama-cpp\llama\llama.cpp\llama.cpp:11163: n_tokens_all <= cparams.n_batch error

@Ademsk1
Copy link
Author

Ademsk1 commented May 6, 2024

We can try and use the Accessibility feature on playwright
https://playwright.dev/docs/accessibility-testing
This would extract all the text. Could be a good start to reduce the HTML size.
@mishushakov

@siquick
Copy link

siquick commented May 11, 2024

Also getting this on GPT-4-Turbo on some web pages. Only seems to hit the context length when mode: "html" but I find that mode: "text" isn't as accurate.

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

3 participants