Skip to content

Fix: Refactor Batching notebook to use new sampler chain API #1793

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

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

lukestanley
Copy link
Contributor

@lukestanley lukestanley commented Oct 13, 2024

  • Replaced deprecated llama_sample_token with llama_sampler_sample
  • Updated llama_token_to_piece signature to include lstrip and special arguments
  • Changed llama_load_model_from_file to use positional argument for params (currently does not accept a keyword argument for it)
    @abetlen

- Replaced deprecated llama_sample_token with llama_sampler_sample
- Updated llama_token_to_piece signature to include lstrip and special arguments
- Changed llama_load_model_from_file to use positional argument for params (currently does not accept a keyword argument for it)
@lukestanley lukestanley force-pushed the fix-batching-notebook branch from 8793382 to 4dbe738 Compare October 13, 2024 16:12
@lukestanley
Copy link
Contributor Author

lukestanley commented Oct 13, 2024

I was trying to figure out what regressed with the low level API, and I saw that there was a bit more recent batching notebook. But the Batching notebook itself was broken so I fixed it.

I had to diff changes in llama_cpp.py to find the API changes.

To use GitHub Codespaces after making a Codespace from the branch, I had to:

git submodule update --init --recursive
pip install --upgrade pip
pip install -e .
wget "https://huggingface.co/TheBloke/Mistral-7B-v0.1-GGUF/resolve/main/mistral-7b-v0.1.Q2_K.gguf?download=true"
mv "mistral-7b-v0.1.Q2_K.gguf?download=true" "mistral-7b-v0.1.Q2_K.gguf"

When Codespace offers to install the Jupyter extension, I accepted it.
I am then able to run the whole notebook.

@lukestanley lukestanley marked this pull request as ready for review October 13, 2024 16:18
@abetlen abetlen merged commit d610477 into abetlen:main Dec 6, 2024
14 checks passed
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

Successfully merging this pull request may close these issues.

2 participants