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

Query ignoring condition and then failing for unknown reason #61

Closed
JasperDekoninck opened this issue May 5, 2023 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@JasperDekoninck
Copy link

The following query fails:

argmax(chatty_openai=True, max_len=256)
   "A rhyme:\n"
   "Verse: [RHYME_START]\n"
   for i in range(5):
      "Verse: [RHYME]\n"
from
   'openai/text-davinci-003'
where
   len(TOKENS(RHYME)) == 5 and len(TOKENS(RHYME_START)) == 5

I am not sure why, but the first RHYME variable does not stop after five tokens. However, if I remove the "RHYME START" variable completely, the query works fine again. I also ran several variations of this query where sometimes it works and sometimes it fails at the second RHYME variable. I cannot really figure out what is going wrong though.

@JasperDekoninck
Copy link
Author

JasperDekoninck commented May 5, 2023

It seems that something is wrong with the equality operator, since the following query also fails for the same reason, but now on the variable "NAME". Changing the condition on RHYME to e.g. len(RHYME) < 10 fixes the issue. What's interesting here as well, is that in this case NAME stops on the second occurrence of the apostrophe, and not on the first.

argmax(chatty_openai=True, max_len=256)
   "A rhyme named '[NAME]':\n"
   for i in range(5):
      "Verse: [RHYME]\n"
from
   'openai/text-davinci-003'
where
   len(RHYME) == 10 and STOPS_BEFORE(NAME, "'")

@lbeurerkellner lbeurerkellner added the bug Something isn't working label May 6, 2023
@lbeurerkellner
Copy link
Collaborator

Thanks for reporting this. Both queries are now fixed on 'main' and on the web. The issue here was that internally the equality constraint was type-dispatched to the generic implementation and not the integer-specific one, because early in query execution, we do not know about the type of len(RHYME) yet.

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