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

Issues with LLaMA model and constraints #95

Closed
irajmoradi opened this issue Jun 15, 2023 · 2 comments
Closed

Issues with LLaMA model and constraints #95

irajmoradi opened this issue Jun 15, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@irajmoradi
Copy link

Hello,

I have encountered an issue when running this code, where I am running my code on the LLaMA model.

sample(temperature=0.8)
   "A list of things not to forget when going to the sea (not travelling, and choose Bathing Suite as the first one): \n"
   "- Sunglasses \n"
   for i in range(4):
      "- [THING] \n"
from
   '/riemann/hugging'
where
   THING in set(["Volleyball Shoes", "Bathing Suite"])

The output ends up being just Bathing, and then continuing to run until it ends with just "Bathing".

@lbeurerkellner
Copy link
Collaborator

As mentioned in the Discord, I had a look. Seems like the HF LlamaTokenizer behaves different from other tokenizers in ‚transformers‘ when it comes to decoding tokens with leading spaces. Will need a fix. I thought this was fixed on their end, but apparently not yet. It will need some special handling from our side then. Sorry about that. Feel free to create a GH issue.

@lbeurerkellner lbeurerkellner added the bug Something isn't working label Jun 18, 2023
This was referenced Jun 18, 2023
@lbeurerkellner
Copy link
Collaborator

lbeurerkellner commented Jul 17, 2023

This was fixed in the latest release, e.g. the following code works with the huggyllama/llama-7b model and tokenizer:

sample(temperature=1.8, chunksize=1)
   "A list of things not to forget when going to the sea (not travelling, and choose Bathing Suite as the first one): \n"
   "- Sunglasses \n"
   for i in range(40):
      "- [THING] \n"
from
   'huggyllama/llama-7b'
where
   THING in set(["Volleyball Shoes", "Bathing Suite"])

This should enable broader llama compatibility, including our recent addition of llama.cpp as an inference backend.

Note that HF advises to not use outdated llama models from the hub, as some (slow variant) tokenizer implementation still contained buggy behaviour, which can also affect LMQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants